:root {
  --color-navy: #0b1f3a;
  --color-deep-blue: #112b52;
  --color-emerald: #1b9c85;
  --color-amber: #cba76b;
  --color-cream: #f7f3ec;
  --color-muted: #6b7c93;
  --color-crimson: #f26b6b;
  --color-surface: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 16px 45px rgba(11, 31, 58, 0.25);
  --shadow-card: 0 22px 60px rgba(12, 24, 46, 0.35);
  --radius-lg: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(27, 156, 133, 0.28), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(203, 167, 107, 0.22), transparent 55%),
              linear-gradient(140deg, #061126, #0c2345 55%, #10345c);
  color: #fefefe;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 2rem;
}

.app-shell {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.75rem;
}

.hero {
  background: linear-gradient(135deg, rgba(17, 43, 82, 0.9), rgba(27, 156, 133, 0.6));
  border-radius: var(--radius-lg);
  padding: 2.75rem 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.brand__logo {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  box-shadow: 0 14px 30px rgba(27, 156, 133, 0.35);
}

.brand__copy h1 {
  margin: 0 0 0.3rem;
  font-size: 2.2rem;
  letter-spacing: 0.04em;
}

.brand__copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
}

.install-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  background: rgba(203, 167, 107, 0.16);
  color: #fefefe;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.install-button:hover {
  background: rgba(203, 167, 107, 0.3);
  transform: translateY(-1px);
}

.content {
  display: grid;
  gap: 1.75rem;
}

.card {
  background: rgba(17, 43, 82, 0.88);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.card__lead {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.72);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.95rem;
}

.field span {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.field input,
.field select {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 31, 58, 0.85);
  color: #fff;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(203, 167, 107, 0.9);
  outline: none;
  box-shadow: 0 0 0 3px rgba(203, 167, 107, 0.25);
}

.primary-action {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1b9c85, #3db79f);
  border: none;
  color: #0b1f3a;
  border-radius: 999px;
  padding: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(27, 156, 133, 0.35);
}

.ghost-action {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  color: #fefefe;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ghost-action:hover {
  background: rgba(255, 255, 255, 0.08);
}

.plan-summary {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.plan-summary__item {
  background: rgba(27, 156, 133, 0.12);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(27, 156, 133, 0.2);
}

.plan-summary__item span {
  display: block;
}

.plan-summary__label {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.35rem;
}

.plan-summary__value {
  font-size: 1.3rem;
  font-weight: 700;
}

.progress {
  margin-top: 1.8rem;
  display: grid;
  gap: 1.4rem;
}

.progress__label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.progress__bar {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(135deg, #1b9c85, #cba76b);
  width: 0%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.progress__value {
  font-size: 1.1rem;
  font-weight: 700;
}

#statusMessage {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

#catchUpMessage {
  display: grid;
  gap: 0.75rem;
  font-size: 1rem;
}

.catchup-alert {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: rgba(203, 167, 107, 0.14);
  border: 1px solid rgba(203, 167, 107, 0.32);
}

.footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer a {
  color: rgba(203, 167, 107, 0.88);
  text-decoration: none;
}

.timeline {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.timeline__track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.timeline__elapsed {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(135deg, rgba(27, 156, 133, 0.75), rgba(17, 43, 82, 0.8));
  z-index: 1;
}

.timeline__lag {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: linear-gradient(135deg, rgba(242, 107, 107, 0.9), rgba(211, 77, 77, 0.85));
  display: none;
  z-index: 2;
  pointer-events: none;
}

.timeline__marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-amber);
  z-index: 3;
  box-shadow: 0 0 0 3px rgba(203, 167, 107, 0.25);
  transition: left 0.3s ease;
}

.timeline__legend {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.timeline__legend span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
}

.timeline__legend strong {
  font-weight: 700;
  color: #fff;
}

.timeline.timeline--behind .timeline__marker {
  background: var(--color-crimson);
  box-shadow: 0 0 0 3px rgba(242, 107, 107, 0.25);
}

.timeline.timeline--behind .timeline__elapsed {
  background: linear-gradient(135deg, rgba(27, 156, 133, 0.55), rgba(11, 31, 58, 0.75));
}

.timeline.timeline--ahead .timeline__marker {
  background: var(--color-emerald);
  box-shadow: 0 0 0 3px rgba(27, 156, 133, 0.25);
}

.timeline.timeline--ahead .timeline__elapsed {
  background: linear-gradient(135deg, rgba(27, 156, 133, 0.9), rgba(203, 167, 107, 0.85));
}


@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }

  .hero {
    padding: 2rem;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand__logo {
    width: 74px;
    height: 74px;
  }

  .brand__copy h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 1.9rem 1.7rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(27, 156, 133, 0.35); }
  70% { box-shadow: 0 0 0 14px rgba(27, 156, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(27, 156, 133, 0); }
}

.install-button:not([hidden]) {
  animation: pulse 2.5s ease infinite;
}
