/* ============================================
   Magic Beacon Updater
   Dark, premium, branded
   ============================================ */

:root {
  --brand-blue: #1F4FCB;
  --brand-blue-bright: #3A6FE3;
  --brand-blue-dark: #163B95;
  --bg-deep: #0A0E1A;
  --bg-mid: #14182A;
  --bg-card: #1A1F33;
  --bg-card-elevated: #232844;
  --text-primary: #FFFFFF;
  --text-secondary: #B4BDD4;
  --text-muted: #6B7390;
  --accent-success: #2DD4BF;
  --accent-warning: #FBBF24;
  --accent-error: #F87171;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
  background:
    radial-gradient(ellipse at top, var(--bg-mid) 0%, var(--bg-deep) 60%),
    var(--bg-deep);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* ============================================
   Layout
   ============================================ */

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.logo {
  max-width: 220px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

/* Note: filter invert turns the black parts of the logo white;
   blue parts stay blue. Works for dark theme. */

/* ============================================
   Cards (one per state)
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* ============================================
   Typography
   ============================================ */

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   Buttons
   ============================================ */

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: var(--brand-blue);
  color: white;
  padding: 1.1rem 1.5rem;
  font-size: 1.05rem;
  border-radius: 12px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 20px rgba(31, 79, 203, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--brand-blue-bright);
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(31, 79, 203, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--bg-card-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ============================================
   Reassurance list (under buttons)
   ============================================ */

.reassurance {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reassurance.subtle {
  margin-top: 1.25rem;
  padding-top: 0;
  border-top: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reassurance-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.reassurance-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-success);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.reassurance.subtle .reassurance-icon {
  width: 18px;
  height: 18px;
}

/* ============================================
   Version comparison
   ============================================ */

.version-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-card-elevated);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.version-current, .version-new {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.version-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.version-number {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.version-new .version-number {
  color: var(--brand-blue-bright);
}

.version-arrow {
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 300;
}

/* ============================================
   Release notes
   ============================================ */

.release-notes {
  margin: 1rem 0 1.5rem;
}

.release-notes-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

#release-notes {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   Progress
   ============================================ */

.progress-container {
  margin-top: 2rem;
}

.progress-bar {
  background: var(--bg-card-elevated);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-blue-bright) 100%);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(58, 111, 227, 0.5);
}

.progress-status {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* ============================================
   Spinner
   ============================================ */

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--bg-card-elevated);
  border-top-color: var(--brand-blue-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Success icon
   ============================================ */

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--accent-success) 0%, #14B8A6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(45, 212, 191, 0.3);
}

.success-icon.celebrate {
  animation: celebrate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrate {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   Footer
   ============================================ */

footer {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--brand-blue-bright);
}

/* ============================================
   Mobile
   ============================================ */

@media (max-width: 480px) {
  .container {
    padding: 2rem 1rem 1.5rem;
  }
  .card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }
  h1 {
    font-size: 1.65rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  .logo {
    max-width: 180px;
  }
}
