/* ============================================================
     Checkout redesign (28 Oct 2026)
     Structure kept from the previous page: plan toggle, email /
     phone fields, subject rows, sticky order summary, Razorpay
     handoff, modal. Card-entry is handled inside Razorpay.
     ============================================================ */
  :root {

    --page: #EEF2EF;
    --paper: #E0E8E2;
    --paper-soft: #E7EDE8;
    --line: #C8D4CA;
    --line-strong: #AEBDB1;

    --ink: #1B2320;
    --muted: #5A6A5A;
    --navy: #1B2320;

    --green: #226E2C;
    --green-fill: #226E2C;
    --green-dark: #1B5F3C;
    --green-tint: #E8F5E5;
    --green-line: #B8E3CB;
    --green-ink: #136239;

    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .05);
  }
  [data-theme="dark"] {
    --page: #1C1917;
    --paper: #24211E;
    --paper-soft: #2E2A26;
    --line: #44403C;
    --line-strong: #78716C;

    --ink: #E7E0D5;
    --muted: #B8ADA0;
    --navy: #E7E0D5;

    --green: #86C79A;
    --green-fill: #1E7F49;
    --green-dark: #17693C;
    --green-tint: #1E2A22;
    --green-line: #3F6B52;
    --green-ink: #A9DDBB;

    --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 14px 30px rgba(0, 0, 0, .28);
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html { height: 100%; }
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--page);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding-bottom: 0;
  }

  /* ---------------- Layout ---------------- */
  .shell {
    flex: 1 0 auto;
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 20px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
  }

  .checkout {
    min-width: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 28px 28px 30px;
  }

  .checkout-head h1 {
    margin: 0 0 4px;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: var(--fs-heading);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -.025em;
    color: var(--ink);
  }
  .checkout-head p {
    margin: 0 0 24px;
    font-size: var(--fs-small);
    color: var(--muted);
  }

  /* ---------------- Product information ---------------- */
  .product-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  .product-stat {
    flex-shrink: 0;
    min-width: 150px;
    padding-right: 24px;
    border-right: 1px solid var(--line);
  }
  .product-stat-num {
    display: block;
    font-size: var(--fs-heading);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .product-stat-label {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-caption);
    line-height: 1.35;
    font-weight: 600;
    color: var(--muted);
  }
  .product-copy { min-width: 0; }
  .product-eyebrow {
    margin: 0 0 3px;
    font-size: var(--fs-caption);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .product-title {
    margin: 0;
    font-size: var(--fs-ui);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.35;
    color: var(--ink);
  }
  .product-note {
    margin: 3px 0 0;
    font-size: var(--fs-small);
    line-height: 1.5;
    color: var(--muted);
  }

  /* ---------------- Stepper ---------------- */
  .steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
  }
  .step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }
  .step:not(:first-child)::before {
    content: "";
    position: absolute;
    top: 11px;
    left: calc(-50% + 22px);
    right: calc(50% + 22px);
    height: 1.5px;
    background: var(--line);
  }
  .step-dot {
    position: relative;
    z-index: 1;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--paper);
    color: var(--muted);
    display: grid;
    place-items: center;
    font-size: var(--fs-caption);
    font-weight: 800;
    line-height: 1;
  }
  .step-label {
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
  }
  .step.is-current .step-dot {
    border-color: var(--green-fill);
    background: var(--green-fill);
    color: #fff;
    box-shadow: 0 0 0 4px var(--green-tint);
  }
  .step.is-current .step-label { color: var(--ink); font-weight: 700; }

  /* ---------------- Sections ---------------- */
  .panel + .panel {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
  }
  .panel-h {
    margin: 0 0 3px;
    font-size: var(--fs-ui);
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink);
  }
  .panel-sub {
    margin: 0 0 14px;
    font-size: var(--fs-small);
    line-height: 1.5;
    color: var(--muted);
  }

  /* ---------------- Plan toggle ---------------- */
  .plan-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .plan-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--motion-base) var(--ease-standard), background var(--motion-base) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
    -webkit-tap-highlight-color: transparent;
  }
  .plan-tab:hover { border-color: var(--line-strong); }
  .plan-tab:active { transform: translateY(1px); }
  .plan-tab:focus-visible {
    outline: 3px solid var(--green-line);
    outline-offset: 2px;
  }
  .plan-tab.is-active {
    border-color: var(--green);
    background: var(--green-tint);
    box-shadow: inset 0 0 0 1px var(--green);
  }

  .plan-icon-wrap {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--green-ink);
  }
  .plan-icon { width: 1em; height: 1em; fill: currentColor; }
  .plan-text { display: block; min-width: 0; flex: 1; }
  .plan-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
  }
  .plan-name {
    font-weight: 800;
    font-size: var(--fs-ui);
    line-height: 1.2;
    color: var(--ink);
  }
  .plan-note {
    display: block;
    font-size: var(--fs-caption);
    line-height: 1.45;
    color: var(--muted);
  }
  .plan-tab.is-active .plan-note { color: var(--green-ink); }
  .plan-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--green-fill);
    color: #fff;
    font-size: var(--fs-caption);
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.5;
    white-space: nowrap;
  }

  /* ---------------- Fields ---------------- */
  .fields { display: grid; gap: 14px; }
  .field label {
    display: block;
    font-size: var(--fs-small);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
  }
  .field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: var(--fs-ui);
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease;
  }
  .field input::placeholder { color: var(--muted); opacity: .7; }
  .field input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31, 138, 78, .16);
  }
  [data-theme="dark"] .field input:focus {
    box-shadow: 0 0 0 3px rgba(53, 180, 114, .24);
  }

  /* ---------------- Subject rows ---------------- */
  .subjects { display: grid; gap: 8px; }
  .subject {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: var(--fs-ui);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--motion-base) var(--ease-standard), background var(--motion-base) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
    -webkit-tap-highlight-color: transparent;
  }
  .subject:hover:not(.is-selected) { background: var(--paper-soft); border-color: var(--line-strong); }
  .subject:active:not(.is-selected) { transform: translateY(1px); }
  .subject:focus-visible {
    outline: 3px solid var(--green-line);
    outline-offset: 2px;
  }
  .subject.is-selected {
    border-color: var(--green-line);
    background: var(--green-tint);
  }
  .subject .checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: transparent;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
  }
  .subject.is-selected .checkbox {
    background: var(--green-fill);
    border-color: var(--green-fill);
  }
  .subject .checkbox svg { width: 1em; height: 1em; fill: currentColor; color: #fff; visibility: hidden; }
  .subject.is-selected .checkbox svg { visibility: visible; }
  .subject .name { flex: 1; min-width: 0; font-weight: 700; line-height: 1.3; }
  .subject .price {
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  /* ---------------- Order summary ---------------- */
  .sticky {
    position: sticky;
    top: 84px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
  }
  .sticky-inner { display: grid; gap: 0; }
  .sum-title {
    margin: 0 0 12px;
    font-size: var(--fs-caption);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .sum-plan {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--fs-small);
    color: var(--muted);
    padding-bottom: 10px;
  }
  .sum-plan b { color: var(--ink); font-weight: 700; }
  .sum-count {
    display: block;
    font-size: var(--fs-small);
    line-height: 1.45;
    color: var(--muted);
    padding: 10px 0;
    border-top: 1px dashed var(--line);
  }
  .sum-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .sum-total-label {
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--muted);
  }
  #total {
    font-size: var(--fs-display);
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .cta {
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid #E0A800;
    border-radius: 12px;
    background: var(--brand-yellow);
    color: #0B1F3A;
    font-family: inherit;
    font-size: var(--fs-ui);
    font-weight: 800;
    letter-spacing: -.01em;
    cursor: pointer;
    box-shadow: 0 2px 0 #E0A800, 0 8px 18px rgba(11, 31, 58, .16);
    transition: transform var(--motion-fast) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), filter var(--motion-base) var(--ease-standard);
    -webkit-tap-highlight-color: transparent;
  }
  .cta:hover:not(:disabled) { filter: brightness(.97); }
  .cta:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #E0A800; }
  .cta:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
  .cta:disabled {
    background: var(--line);
    border-color: var(--line);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
  }
  .micro {
    margin: 12px 0 0;
    text-align: center;
    font-size: var(--fs-caption);
    line-height: 1.5;
    color: var(--muted);
  }

  /* ---------------- Error ---------------- */
  .error {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #F0C4C4;
    background: #FDECEC;
    border-radius: 10px;
    color: #8A1D1D;
    font-size: var(--fs-small);
    line-height: 1.5;
  }
  [data-theme="dark"] .error {
    background: #3A1B1B;
    border-color: #6B2B2B;
    color: #F3B5B5;
  }

  /* ---------------- Modal ---------------- */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 14, 24, 0.5);
    animation: fadeIn var(--motion-base) var(--ease-standard);
  }
  .modal-backdrop[hidden] { display: none; }
  .modal-card {
    width: 100%;
    max-width: 420px;
    padding: 34px 28px 26px;
    border-radius: 20px;
    background: var(--paper);
    text-align: center;
    box-shadow: 0 24px 60px rgba(11, 31, 58, .28);
    animation: popIn .2s ease;
  }
  .modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    line-height: 1;
  }
  .modal-icon svg { width: 36px; height: 36px; }
  .modal-icon.info    { background: #EEF6FF; color: #1E4D8A; }
  .modal-icon.warn    { background: #FFF8E8; color: #B8860B; }
  .modal-icon.danger  { background: #FDECEC; color: #8A1D1D; }
  .modal-icon.success { background: #E8F5EC; color: #1E5F3D; }
  .modal-spinner {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto 20px;
    color: var(--green);
    animation: spin .9s linear infinite;
  }
  .modal-title {
    margin: 0 0 10px;
    font-size: var(--fs-emphasis);
    font-weight: 800;
    line-height: 1.3;
    color: var(--ink);
  }
  .modal-msg {
    margin: 0 0 22px;
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--muted);
    word-break: break-word;
  }
  .modal-pid {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--page);
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--fs-small);
    font-weight: 700;
    user-select: all;
  }
  .modal-btn {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: var(--green-fill);
    color: #fff;
    font-family: inherit;
    font-size: var(--fs-body);
    font-weight: 800;
    cursor: pointer;
  }
  .modal-btn:hover { background: var(--green-dark); }
  .modal-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
  .foot { flex-shrink: 0; }
  @keyframes spin   { to { transform: rotate(360deg); } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes popIn  { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

  /* ---------------- Responsive ---------------- */
  @media (max-width: 899px) {
    body { padding-bottom: 0; }
    .foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    .shell {
      grid-template-columns: 1fr;
      gap: 18px;
      padding: 18px 0 32px;
    }
    .checkout { padding: 22px 20px 24px; border-radius: var(--radius-lg, 14px); }
    .product-card { padding: 18px; border-radius: var(--radius-lg, 14px); }

    /* Summary becomes the fixed action bar */
    .sticky {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      top: auto;
      z-index: 60;
      padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
      border: 0;
      border-top: 1px solid var(--line);
      border-radius: 0;
      box-shadow: 0 -8px 24px rgba(16, 24, 40, .10);
    }
    .sticky-inner {
      max-width: 980px;
      margin: 0 auto;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas: "total cta";
      align-items: center;
      gap: 0 14px;
    }
    .sum-title { display: none; }
    .sum-plan { display: none; }
    .sum-count { display: none; }
    .sum-total {
      grid-area: total;
      margin: 0;
      padding: 0;
      border: 0;
      justify-content: flex-start;
      gap: 8px;
    }
    .sum-total-label { font-size: var(--fs-caption); }
    #total { font-size: var(--fs-emphasis); }
    .cta {
      grid-area: cta;
      width: auto;
      min-width: 168px;
      padding: 0 18px;
      min-height: 48px;
    }
    .micro { display: none; }
  }

  @media (max-width: 560px) {
    .checkout-head h1 { font-size: var(--fs-display); }
    .checkout-head p { margin-bottom: 20px; }
    .plan-toggle { grid-template-columns: 1fr; }
    .subject { padding: 13px 14px; gap: 12px; font-size: var(--fs-small); }
    .steps { margin-bottom: 22px; }
    .step-label { font-size: var(--fs-caption); }
    .cta { min-width: 0; padding: 0 14px; }
    .product-card {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }
    .product-stat {
      display: flex;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
      padding: 0;
      border: 0;
    }
    .product-stat-num { font-size: var(--fs-display); }
    .product-stat-label { margin: 0; }
  }

  @media (max-width: 380px) {
    .cta { font-size: var(--fs-small); }
    #total { font-size: var(--fs-emphasis); }
    .sum-total-label { display: none; }
  }

.razorpay-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: center;
}

.razorpay-logo {
  display: block;
  width: auto;
  height: 18px;
}

html[data-theme="dark"] .razorpay-logo {
  filter: brightness(0) invert(1);
}
