/* The one checkout dialog, used by pricing.html and dashboard.html (Credit Bank).
   Both pages carry the brand tokens (pricing inline, dashboard via styles.css); the
   fallbacks below only cover the few a page does not define. Root: .checkout-modal,
   shown by adding .open. */
.checkout-modal {
  --co-overlay: rgba(5,8,20,0.75);
  --co-ok: var(--green-text, #22C55E);
  --co-bad: var(--red-text, #F4595B);
  /* Pinned: the two pages' --text-faint differ in light mode; this is the AA-readable one. */
  --co-faint: #5C6890;
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: var(--co-overlay);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
}
[data-theme="light"] .checkout-modal {
  --co-overlay: rgba(10,16,38,0.60);
  --co-ok: var(--green-text, #166534);
  --co-bad: var(--red-text, #C0362F);
  --co-faint: #5C6690;
}
.checkout-modal.open { display: flex; }
.checkout-modal .modal-box {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-hi); border-radius: var(--r-lg);
  padding: 34px 32px 28px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-card), var(--glow-gold); position: relative; overflow: hidden;
  text-align: left;
}
.checkout-modal .modal-box::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad-gold);
}
.checkout-modal .modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: 0;
  color: var(--co-faint); font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 6px;
}
.checkout-modal .modal-close:hover { color: var(--text); }
.checkout-modal .modal-plan-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px;
  background: var(--tint-gold); border: 1px solid var(--tint-gold-line); color: var(--gold-text);
  font-family: "JetBrains Mono", monospace; font-size: .78rem; font-weight: 700;
  letter-spacing: .03em; margin-bottom: 14px;
}
.checkout-modal .modal-plan-badge s { opacity: .6; font-weight: 400; }
.checkout-modal h2 { font-family: "Sora", sans-serif; font-size: 1.3rem; letter-spacing: -.03em; margin: 0 0 6px; color: var(--text); }
.checkout-modal .modal-sub { color: var(--text-dim); font-size: .88rem; line-height: 1.55; margin: 0 0 20px; overflow-wrap: anywhere; }
.checkout-modal .modal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.checkout-modal .modal-field label { font-family: "Sora", sans-serif; font-size: .8rem; font-weight: 600; color: var(--text-mid); }
.checkout-modal .label-optional { font-weight: 400; color: var(--co-faint); }
.checkout-modal .modal-field input {
  background: var(--bg); border: 1px solid var(--border-hi); border-radius: var(--r-sm);
  padding: 12px 15px; min-height: 48px; color: var(--text);
  font: inherit; font-size: .94rem; outline: none; width: 100%; box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s;
}
.checkout-modal .modal-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--tint-gold); }
.checkout-modal .modal-field input::placeholder { color: var(--co-faint); }
.checkout-modal .modal-field input[readonly] { color: var(--text-dim); }
.checkout-modal .modal-code-row { display: flex; gap: 8px; }
.checkout-modal .modal-code-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .06em; font-family: "JetBrains Mono", monospace; }
.checkout-modal .modal-code-btn { padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-hi); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.checkout-modal .modal-code-btn:hover { border-color: var(--gold); }
.checkout-modal .modal-code-btn:disabled { opacity: .6; cursor: default; }
.checkout-modal .modal-code-msg { font-size: .8rem; margin: 6px 0 0; min-height: 1.2em; color: var(--text-dim); }
.checkout-modal .modal-code-msg.ok { color: var(--co-ok); font-weight: 600; }
.checkout-modal .modal-code-msg.bad { color: var(--co-bad); }
.checkout-modal .modal-error {
  display: none; color: var(--co-bad); font-size: .86rem; margin-bottom: 12px;
  border: 1px solid rgba(244,89,91,.32); border-radius: var(--r-sm);
  padding: 10px 13px; background: rgba(244,89,91,.07);
}
.checkout-modal .modal-error.visible { display: block; }
.checkout-modal .modal-cta {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px;
  border-radius: var(--r-sm); font-family: "Sora", sans-serif; font-size: .95rem; font-weight: 700;
  cursor: pointer; background: var(--grad-gold); border: 0; color: #3A2600;
  box-shadow: 0 8px 24px rgba(240,165,0,.28); margin-top: 4px;
  transition: transform .15s, box-shadow .2s, opacity .15s;
}
.checkout-modal .modal-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(240,165,0,.38); }
.checkout-modal .modal-cta:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.checkout-modal .modal-legal { margin: 14px 0 0; font-size: .76rem; color: var(--co-faint); text-align: center; line-height: 1.6; }
.checkout-modal .modal-legal a { color: var(--gold-text); }
[data-theme="light"] .checkout-modal .modal-legal a { color: var(--blue); }
