/* ============================================================================
 * style.css — TV2Z Subscription Builder
 * ----------------------------------------------------------------------------
 * A premium "10-foot" Android TV aesthetic: large type, large cards, generous
 * spacing, a visible focus ring with scale + glow, and smooth 60fps transitions.
 * No frameworks. All colors & sizes come from the design tokens below.
 * ==========================================================================*/

/* ---- Design tokens --------------------------------------------------------*/
:root {
  /* Palette (from the brief) */
  --bg:        #0F1117;
  --panel:     #171A23;
  --card:      #202433;
  --card-2:    #252A3B;
  --primary:   #3B82F6;
  --focus:     #60A5FA;
  --success:   #22C55E;
  --warning:   #F59E0B;
  --danger:    #EF4444;

  /* Text */
  --text:        #F4F6FB;
  --text-dim:    #AEB6CC;
  --text-faint:  #6B7390;
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Type scale (TV — readable from a distance) */
  --fs-heading: 44px;
  --fs-section: 28px;
  --fs-card:    24px;
  --fs-body:    18px;
  --fs-price:   36px;

  /* Radius / spacing / motion */
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --sidebar-w: 380px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 280ms;

  --glow: 0 0 0 3px rgba(96, 165, 250, 0.95), 0 0 30px 4px rgba(96, 165, 250, 0.45), 0 18px 40px rgba(0, 0, 0, 0.55);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* Ambient depth: soft radial glows behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 700px at 78% -10%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(96, 165, 250, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
kbd { font-family: inherit; }

/* ============================================================================
 * App shell layout
 * ==========================================================================*/
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
}
.app.no-sidebar { grid-template-columns: 1fr; }
.app.no-sidebar .sidebar { display: none; }

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

/* ---- Top bar --------------------------------------------------------------*/
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 56px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 26, 35, 0.7), rgba(15, 17, 23, 0));
  transition: opacity var(--speed) var(--ease);
}
.app.chrome-hidden .topbar { opacity: 0; pointer-events: none; }

.topbar-brand { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.topbar-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #6366F1);
  border-radius: 11px;
  font-weight: 800; font-size: 22px;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}
.topbar-brand-name { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }

/* Progress steps */
.progress {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* `.progress { display:flex }` outranks the UA [hidden] rule, so make the
   hidden attribute explicitly hide it (used on non-builder screens). */
.progress[hidden] { display: none; }
.top-title[hidden] { display: none; }
.progress-step { display: flex; align-items: center; gap: 11px; opacity: 0.5; transition: opacity var(--speed) var(--ease); }
.progress-step.is-active, .progress-step.is-done { opacity: 1; }
.progress-dot {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line-strong);
  font-size: 16px; font-weight: 700;
  transition: all var(--speed) var(--ease);
}
.progress-step.is-active .progress-dot { background: var(--primary); border-color: var(--focus); box-shadow: 0 0 18px rgba(96, 165, 250, 0.55); }
.progress-step.is-done .progress-dot { background: rgba(34, 197, 94, 0.18); border-color: var(--success); color: var(--success); }
.progress-label { font-size: 16px; font-weight: 600; color: var(--text-dim); }
.progress-step.is-active .progress-label { color: var(--text); }
.progress-sep { width: 30px; height: 2px; background: var(--line-strong); border-radius: 2px; }

.top-title { flex: 1 1 auto; text-align: center; font-size: 22px; font-weight: 700; color: var(--text-dim); }

/* Remote hints */
.remote-hints { flex: 0 0 auto; display: flex; gap: 20px; }
.hint { display: flex; align-items: center; gap: 8px; }
.hint-key {
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  padding: 5px 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line-strong); color: var(--text-dim);
}
.hint-label { font-size: 13px; color: var(--text-faint); }

/* ---- Screens region -------------------------------------------------------*/
.screens { position: relative; flex: 1 1 auto; min-height: 0; }

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 44px 56px 64px;
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  pointer-events: none;
  /* visibility:hidden (not just opacity) removes inactive screens from the tab
     order and the accessibility tree, so off-screen buttons aren't reachable. */
  visibility: hidden;
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
  scrollbar-width: thin;
  scrollbar-color: var(--card-2) transparent;
}
.screen::-webkit-scrollbar { width: 10px; }
.screen::-webkit-scrollbar-thumb { background: var(--card-2); border-radius: 8px; }
.screen.is-active { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }

.screen-body { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 36px; }

/* ---- Shared headings ------------------------------------------------------*/
.screen-head { display: flex; flex-direction: column; gap: 8px; }
.eyebrow {
  font-size: 15px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--focus);
}
.screen-title { font-size: var(--fs-heading); font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.screen-sub { font-size: 20px; color: var(--text-dim); max-width: 720px; }

.screen-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ============================================================================
 * Buttons & focus ring
 * ==========================================================================*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 17px 34px;
  font-size: 19px; font-weight: 700;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
              background var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.btn-lg { padding: 20px 44px; font-size: 21px; }
.btn-primary {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}
.btn-ghost { background: transparent; color: var(--text-dim); }

/* The TV focus highlight — applied by the navigation engine. */
.focusable { outline: none; }
.focusable.is-focused {
  position: relative;
  z-index: 5;
}
.btn.is-focused {
  transform: scale(1.05);
  border-color: var(--focus);
  box-shadow: var(--glow);
}
.btn-primary.is-focused { background: linear-gradient(135deg, #4f8ff8, #2f6ae8); }

/* ============================================================================
 * Splash
 * ==========================================================================*/
#screen-splash { display: grid; place-items: center; padding: 0; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.splash-logo { display: flex; align-items: center; gap: 22px; animation: rise 700ms var(--ease) both; }
.logo-mark {
  width: 96px; height: 96px;
  display: grid; place-items: center;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--primary), #6366F1);
  font-size: 54px; font-weight: 800;
  box-shadow: 0 20px 50px rgba(59, 130, 246, 0.45);
}
.logo-text { text-align: left; }
.logo-brand { font-size: 64px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.logo-sub { font-size: 26px; font-weight: 600; color: var(--text-dim); margin-top: 4px; }
.splash-operator { font-size: 18px; color: var(--text-faint); animation: rise 700ms 120ms var(--ease) both; }

.splash-loader { width: 280px; height: 5px; border-radius: 4px; background: var(--card); overflow: hidden; margin-top: 10px; }
.splash-loader-bar {
  width: 40%; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--focus));
  animation: loaderSlide 1.4s var(--ease) forwards;
}
.splash-loader.is-done { opacity: 0; height: 0; margin: 0; transition: all 400ms var(--ease); }

.splash-actions {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  margin-top: 8px;
  opacity: 0; transform: translateY(12px);
  pointer-events: none;
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}
.splash-actions.is-ready { opacity: 1; transform: none; pointer-events: auto; }

@keyframes loaderSlide { from { transform: translateX(-120%); } to { transform: translateX(330%); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ============================================================================
 * Current subscription
 * ==========================================================================*/
.current-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 22px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 30px;
}
.panel-title { font-size: var(--fs-section); font-weight: 700; margin-bottom: 16px; }
.info-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 18px;
}
.info-row:first-of-type { border-top: none; }
.info-icon { width: 30px; text-align: center; font-size: 20px; opacity: 0.9; }
.info-label { flex: 1 1 auto; color: var(--text); }
.info-value { color: var(--text-dim); font-weight: 600; font-size: 16px; }

/* ============================================================================
 * Cards (base plans)
 * ==========================================================================*/
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  position: relative;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 30px;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
              border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.card.is-focused { transform: scale(1.045) translateY(-2px); border-color: var(--focus); box-shadow: var(--glow); }

.plan-card { display: flex; flex-direction: column; gap: 14px; min-height: 360px; }
.plan-card.is-selected { border-color: var(--primary); background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), var(--card)); }
.plan-card.is-recommended { border-color: rgba(96, 165, 250, 0.4); }

.badge {
  position: absolute; top: -13px; left: 28px;
  background: linear-gradient(135deg, var(--primary), #6366F1);
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 20px;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45);
}
.card-check {
  position: absolute; top: 24px; right: 26px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 19px; font-weight: 800;
}
.card-name { font-size: 30px; font-weight: 800; }
.card-desc { font-size: 17px; color: var(--text-dim); line-height: 1.4; }
.plan-features { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; flex: 1 1 auto; }
.plan-feature { position: relative; padding-left: 30px; font-size: 17px; color: var(--text); }
.plan-feature::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--success); font-weight: 800;
}
.card-price { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.price-value { font-size: var(--fs-price); font-weight: 900; letter-spacing: -1px; }
.price-unit { font-size: 19px; color: var(--text-dim); font-weight: 600; }

/* ============================================================================
 * Bundle cards (horizontal row)
 * ==========================================================================*/
.bundle-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 20px;
}
.bundle-card { display: flex; flex-direction: column; gap: 12px; min-height: 252px; padding: 26px 24px; }
.bundle-card.is-on { border-color: var(--primary); background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), var(--card)); }
.bundle-card.is-locked { opacity: 0.92; }
.bundle-icon { font-size: 40px; }
.bundle-channels { font-size: 15px; color: var(--text-faint); }
.bundle-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.bundle-price { font-size: 21px; font-weight: 800; }

.pill {
  font-size: 14px; font-weight: 700; letter-spacing: 0.3px;
  padding: 6px 13px; border-radius: 20px;
}
.pill-included { background: rgba(34, 197, 94, 0.16); color: var(--success); }

.toggle-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  position: relative; transition: all var(--speed) var(--ease);
}
.toggle-dot.is-on { background: var(--primary); border-color: var(--primary); }
.toggle-dot.is-on::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800; }

/* ============================================================================
 * Features list (toggles + counter)
 * ==========================================================================*/
.feature-list { display: flex; flex-direction: column; gap: 16px; }
.feature-item {
  display: flex; align-items: center; gap: 22px;
  width: 100%; text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.feature-item.is-focused { transform: scale(1.018); border-color: var(--focus); box-shadow: var(--glow); }
.feature-item.is-on:not(.is-locked) { border-color: rgba(59, 130, 246, 0.5); }
.feature-icon {
  width: 56px; height: 56px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 26px;
  background: var(--card-2); border-radius: var(--r-md);
}
.feature-text { flex: 1 1 auto; min-width: 0; }
.feature-name { font-size: var(--fs-card); font-weight: 700; }
.feature-desc { font-size: 16px; color: var(--text-dim); margin-top: 3px; }
.feature-control { display: flex; align-items: center; gap: 20px; flex: 0 0 auto; }
.feature-price { font-size: 19px; font-weight: 700; color: var(--text-dim); }

/* iOS-style switch */
.switch {
  width: 64px; height: 36px; border-radius: 22px;
  background: var(--card-2); border: 2px solid var(--line-strong);
  position: relative; transition: all var(--speed) var(--ease); flex: 0 0 auto;
}
.switch.is-on { background: var(--primary); border-color: var(--primary); }
.switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; transition: transform var(--speed) var(--ease);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.switch.is-on .switch-knob { transform: translateX(28px); }

/* Counter */
.feature-item.is-counter { cursor: default; }
.counter { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.counter-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--card-2); border: 2px solid var(--line-strong);
  font-size: 30px; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease), opacity var(--speed) var(--ease);
}
.counter-btn.is-focused { transform: scale(1.12); border-color: var(--focus); box-shadow: var(--glow); }
.counter-btn.is-disabled { opacity: 0.35; cursor: not-allowed; }
.counter-value { min-width: 44px; text-align: center; font-size: 38px; font-weight: 900; }
.counter-value.bump { animation: bump 320ms var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.28); color: var(--focus); } 100% { transform: scale(1); } }

/* ============================================================================
 * Reconciliation
 * ==========================================================================*/
.reconcile-body { display: flex; flex-direction: column; gap: 28px; }
.reconcile-group { display: flex; flex-direction: column; gap: 14px; }
.reconcile-group-title { font-size: 21px; font-weight: 700; color: var(--text-dim); }
.reconcile-item {
  display: flex; gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 28px;
}
.reconcile-item.is-decision { flex-wrap: wrap; border-color: rgba(245, 158, 11, 0.3); background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), var(--panel)); }
.reconcile-item-mark {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  font-size: 22px; font-weight: 800;
  background: rgba(34, 197, 94, 0.18); color: var(--success);
}
.reconcile-item-mark.is-warn { background: rgba(245, 158, 11, 0.18); color: var(--warning); }
.reconcile-item-text { flex: 1 1 280px; }
.reconcile-item-title { font-size: 21px; font-weight: 700; }
.reconcile-item-msg { font-size: 17px; color: var(--text-dim); margin-top: 5px; line-height: 1.45; }

.decision-options { display: flex; gap: 14px; width: 100%; margin-top: 4px; }
.decision-option {
  flex: 1 1 0;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 3px;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.decision-option.is-chosen { border-color: var(--primary); background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), var(--card)); }
.decision-option.is-focused { transform: scale(1.03); border-color: var(--focus); box-shadow: var(--glow); }
.decision-option-label { font-size: 19px; font-weight: 700; }
.decision-option-sub { font-size: 15px; color: var(--text-dim); }
.reconcile-actions { margin-top: 8px; }

/* ============================================================================
 * Review changes
 * ==========================================================================*/
.review-table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px 30px;
}
.review-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 60px 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 19px;
}
.review-row:first-child { border-top: none; }
.review-head { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); font-weight: 700; padding: 14px 0; }
.review-label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.review-detail { font-size: 14px; color: var(--text-faint); font-weight: 500; }
.review-before { color: var(--text-faint); }
.review-arrow { text-align: center; color: var(--text-dim); font-size: 22px; }
.review-after { display: flex; align-items: center; gap: 12px; font-weight: 700; flex-wrap: wrap; }
.status-removed .review-after { color: var(--danger); }

.tag {
  font-size: 13px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 4px 11px; border-radius: 14px;
}
.tag-added { background: rgba(34, 197, 94, 0.18); color: var(--success); }
.tag-removed { background: rgba(239, 68, 68, 0.18); color: var(--danger); }
.tag-changed { background: rgba(96, 165, 250, 0.18); color: var(--focus); }

.review-cost {
  display: flex; flex-direction: column; gap: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), var(--panel));
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--r-lg);
  padding: 28px 32px;
}
.review-cost-line { display: flex; align-items: baseline; gap: 18px; }
.review-cost-label { font-size: 22px; font-weight: 700; flex: 1 1 auto; }
.review-cost-before { font-size: 28px; font-weight: 700; color: var(--text-faint); text-decoration: line-through; }
.review-cost-after { font-size: 40px; font-weight: 900; letter-spacing: -1px; color: var(--text); }
.review-cost .review-arrow { font-size: 26px; flex: 0 0 auto; }
.review-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.meta-chip {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 18px;
}
.meta-chip-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-faint); font-weight: 700; }
.meta-chip-value { font-size: 18px; font-weight: 700; }

/* ============================================================================
 * Billing
 * ==========================================================================*/
.billing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 36px 38px;
  display: flex; flex-direction: column; gap: 26px;
  max-width: 860px;
}
.billing-total { display: flex; align-items: baseline; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.billing-total-label { font-size: 20px; color: var(--text-dim); flex: 1 1 auto; font-weight: 600; }
.billing-total-value { font-size: 52px; font-weight: 900; letter-spacing: -1.5px; }
.billing-total-unit { font-size: 22px; color: var(--text-dim); font-weight: 600; }
.billing-points { display: flex; flex-direction: column; gap: 20px; }
.billing-point { display: flex; gap: 16px; }
.billing-point-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(34, 197, 94, 0.18); color: var(--success);
  font-size: 18px; font-weight: 800;
}
.billing-point-title { font-size: 20px; font-weight: 700; }
.billing-point-body { font-size: 17px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.billing-note {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 16px; color: var(--text-dim);
}
.billing-note-mark { font-size: 20px; }

/* ============================================================================
 * Success
 * ==========================================================================*/
#screen-success { display: grid; place-items: center; }
.success-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; max-width: 640px; }
.success-check {
  width: 130px; height: 130px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0.12));
  border: 3px solid var(--success);
  font-size: 70px; color: var(--success); font-weight: 900;
  animation: pop 600ms var(--ease) both;
  box-shadow: 0 0 60px rgba(34, 197, 94, 0.4);
}
.success-title { font-size: 50px; font-weight: 900; letter-spacing: -1px; }
.success-sub { font-size: 24px; color: var(--text); }
.success-note { font-size: 18px; color: var(--text-dim); max-width: 520px; line-height: 1.5; }
.success-actions { margin-top: 14px; }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

/* ============================================================================
 * Sidebar (persistent summary)
 * ==========================================================================*/
.sidebar {
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 28px 28px 32px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-head { flex: 0 0 auto; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sidebar-eyebrow { font-size: 15px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.sidebar-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 0; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.summary-heading { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-faint); font-weight: 700; margin: 14px 0 4px; }
.summary-line { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.summary-line-main { flex: 1 1 auto; display: flex; flex-direction: column; }
.summary-line-label { font-size: 18px; font-weight: 600; }
.summary-line-sub { font-size: 13px; color: var(--text-faint); }
.summary-line-value { font-size: 18px; font-weight: 700; color: var(--text-dim); }

.sidebar-total { flex: 0 0 auto; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.sidebar-total-label { font-size: 16px; color: var(--text-dim); font-weight: 600; }
.sidebar-total-amount { display: flex; align-items: baseline; }
.sidebar-total-value {
  font-size: 56px; font-weight: 900; letter-spacing: -2px;
  display: inline-block;
}
.sidebar-total-value.pulse { animation: pulse 420ms var(--ease); }
@keyframes pulse { 0% { color: var(--text); } 35% { color: var(--focus); } 100% { color: var(--text); } }
.sidebar-total-foot { font-size: 13px; color: var(--text-faint); }

/* ============================================================================
 * Toast
 * ==========================================================================*/
.toast-host {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  z-index: 100; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 17px; font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(20px) scale(0.96);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast-mark {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; font-weight: 800;
}
.toast-success .toast-mark { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.toast-info .toast-mark { background: rgba(96, 165, 250, 0.2); color: var(--focus); }

/* ============================================================================
 * Modal
 * ==========================================================================*/
.modal-host { position: fixed; inset: 0; z-index: 200; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 9, 13, 0.72);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  opacity: 0; transition: opacity var(--speed) var(--ease);
}
.modal-host.is-open .modal-backdrop { opacity: 1; }
.modal-card {
  width: min(520px, 90vw);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 36px;
  text-align: center;
  transform: scale(0.92); transition: transform var(--speed) var(--ease);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-host.is-open .modal-card { transform: scale(1); }
.modal-title { font-size: 30px; font-weight: 800; }
.modal-body { font-size: 18px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.modal-actions { display: flex; gap: 14px; justify-content: center; margin-top: 28px; }

/* ============================================================================
 * Responsive — keep usable on a laptop while staying "TV-sized" on big screens
 * ==========================================================================*/
@media (max-width: 1280px) {
  :root { --sidebar-w: 330px; --fs-heading: 38px; }
  .plan-grid { grid-template-columns: repeat(3, 1fr); }
  .screen { padding: 36px 40px 56px; }
  .topbar { padding: 18px 40px; }
  .remote-hints { display: none; }
}
@media (max-width: 1000px) {
  .app, .app.no-sidebar { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .plan-grid { grid-template-columns: 1fr; }
  .progress-label { display: none; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 80ms !important; }
}
