/* ============================================================
   checkout.css — Purchase flow (Details → Payment → Success)
   Reuses tokens from style.css (:root variables, Inter font)
   ============================================================ */

/* ===== Page shell ===== */
.checkout-main {
  background: var(--bg-light);
  min-height: 100vh;
  padding: 104px 0 64px;   /* clear fixed 72px header */
}
.checkout-wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ===== Step indicator ===== */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 32px;
}
.step { display: flex; align-items: center; gap: 10px; }
.step__num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 700;
  background: #fff;
  color: var(--text-light);
  border: 2px solid var(--border);
}
.step__label { font-size: 0.92rem; font-weight: 600; color: var(--text-light); }
.step--active .step__num { background: var(--red); border-color: var(--red); color: #fff; }
.step--active .step__label { color: var(--text); }
.step--done .step__num { background: var(--red); border-color: var(--red); color: #fff; }
.step__line { width: 90px; height: 2px; background: var(--border); margin: 0 14px; }

/* ===== Two-column grid ===== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* ===== Form cards (left) ===== */
.co-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 22px 22px;
  margin-bottom: 18px;
}
.co-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.co-card__icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--red-light); color: var(--red);
  font-size: 1.05rem;
}
.co-card__title { font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.co-card__sub { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }

/* Checkbox rows */
.co-check {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem; color: var(--text-mid);
}
.co-check:hover { border-color: #cfd3da; }
.co-check input { width: 18px; height: 18px; accent-color: var(--red); cursor: pointer; flex-shrink: 0; }
.co-check__warn { margin-left: auto; color: var(--star); font-size: 1rem; }
.co-hint { font-size: 0.82rem; color: var(--text-light); margin: 2px 0 4px; }
.co-hint a { color: var(--red); font-weight: 600; }

/* Inputs */
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.co-field { margin-bottom: 15px; }
.co-field label {
  display: block;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-mid);
  margin-bottom: 6px;
}
.co-field label .req { color: var(--red); }
.co-field input {
  width: 100%;
  font-family: inherit; font-size: 0.92rem;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  transition: var(--transition);
}
.co-field input::placeholder { color: #b6bcc6; }
.co-field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,57,42,0.12); }
.co-field input.is-invalid { border-color: var(--red); }
.co-field__note { font-size: 0.78rem; color: var(--text-light); margin-top: 6px; }
.co-error { font-size: 0.78rem; color: var(--red); margin-top: 5px; display: none; }
.co-error.show { display: block; }

/* Date field: visible English text + custom English calendar popup */
.co-date { position: relative; }
.co-date__text { width: 100%; padding-right: 40px !important; cursor: pointer; background: #fff; }
.co-date__icon {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  pointer-events: none; font-size: 0.95rem; opacity: 0.7;
}

/* Custom calendar (locale-independent — always English) */
.cal {
  position: absolute; z-index: 50;
  top: calc(100% + 6px); left: 0;
  width: 300px; max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 14px;
}
.cal[hidden] { display: none; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal__title { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.cal__nav {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff;
  color: var(--text-mid); font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: var(--transition);
}
.cal__nav:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.cal__nav:disabled { opacity: 0.35; cursor: not-allowed; }
.cal__dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal__dows span {
  text-align: center; font-size: 0.68rem; font-weight: 700;
  color: var(--text-light); text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 0;
}
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__day {
  aspect-ratio: 1 / 1; min-width: 0;
  border: none; background: none; border-radius: 8px;
  font-family: inherit; font-size: 0.85rem; color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.cal__day:hover:not(:disabled) { background: var(--red-light); color: var(--red); }
.cal__day:disabled { color: #cbd0d8; cursor: default; }
.cal__day--empty { background: none; cursor: default; }
.cal__day--today { box-shadow: inset 0 0 0 1px var(--border); font-weight: 700; }
.cal__day--sel, .cal__day--sel:hover { background: var(--red); color: #fff; font-weight: 700; }

/* Continue button */
.co-submit {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-size: 1.02rem; font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 16px rgba(232,57,42,0.28);
}
.co-submit:hover { background: var(--red-dark); }
.co-submit:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.co-submit__lock { margin-right: 6px; }

.co-trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
  margin-top: 14px;
  font-size: 0.8rem; color: var(--text-mid);
}
.co-trust span { display: inline-flex; align-items: center; gap: 5px; }
.co-help { text-align: center; font-size: 0.85rem; color: var(--text-light); margin-top: 14px; }
.co-help a { color: var(--red); font-weight: 600; }

/* ===== Summary card (right) ===== */
.summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 92px;
}
.summary__top {
  background: var(--navy);
  color: #fff;
  padding: 18px 20px 20px;
  position: relative;
}
.summary__rating {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 600;
  background: var(--red);
  margin: -18px -20px 16px;
  padding: 7px 20px;
}
.summary__rating .star { color: #ffd84d; }
.summary__badge {
  display: inline-block;
  background: #6b6a3a;
  color: #f3e9c0;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 5px;
  margin-bottom: 10px;
}
.summary__plan { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.summary__plandesc { font-size: 0.82rem; color: #aeb4c4; margin-top: 4px; }
.summary__price { font-size: 1.55rem; font-weight: 800; margin-top: 14px; }
.summary__price .cur { font-size: 0.85rem; font-weight: 600; color: #aeb4c4; margin-left: 4px; }

.summary__rows { padding: 6px 20px 8px; }
.summary__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.summary__row:last-child { border-bottom: none; }
.summary__row .k { color: var(--text-light); }
.summary__row .v { font-weight: 700; color: var(--text); }
.summary__row .v--green { color: #16a34a; }
.summary__change { text-align: center; padding: 4px 0 18px; }
.summary__change a { color: var(--red); font-weight: 600; font-size: 0.88rem; border-bottom: 1px solid var(--red); }

/* ============================================================
   Account access — email + verification (re-issue gate)
   ============================================================ */
.access-wrap { max-width: 440px; margin: 0 auto; padding: 0 20px; }
.access-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 26px 24px;
}
.access-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.access-card__icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px; display: grid; place-items: center;
  background: var(--red-light); color: var(--red); font-size: 1.15rem;
}
.access-card__title { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.access-card__sub { font-size: 0.85rem; color: var(--text-light); margin-top: 3px; line-height: 1.5; }
.access-card__sub b { color: var(--text); font-weight: 700; }

.access-submit {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: #fff; border: none;
  border-radius: 10px; padding: 14px;
  font-size: 0.98rem; font-weight: 700; cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 16px rgba(232,57,42,0.26);
}
.access-submit:hover { background: var(--red-dark); }
.access-submit:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.access-foot { text-align: center; margin-top: 18px; }
.access-foot a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.88rem; font-weight: 600; color: var(--text-mid);
}
.access-foot a:hover { color: var(--red); }

/* OTP code inputs */
.otp-row { display: flex; gap: 9px; justify-content: space-between; margin-bottom: 6px; }
.otp-row input {
  width: 100%; aspect-ratio: 1 / 1; min-width: 0;
  text-align: center; font-size: 1.3rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font-family: inherit;
  transition: var(--transition);
}
.otp-row input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,57,42,0.12); }
.otp-row input.is-invalid { border-color: var(--red); }
.otp-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 18px; font-size: 0.82rem; color: var(--text-light);
}
.otp-resend {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 0.82rem; font-weight: 600; color: var(--text-mid);
  cursor: pointer; transition: var(--transition);
}
.otp-resend:hover { border-color: var(--red); color: var(--red); }
.access-demo-tag {
  display: block; text-align: center; margin-top: 14px;
  font-size: 0.72rem; color: var(--text-light);
}
.access-view { display: none; }
.access-view.show { display: block; }

/* ===== Processing overlay ===== */
.pay-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(20,24,40,0.55);
  display: none; place-items: center;
  backdrop-filter: blur(2px);
}
.pay-overlay.show { display: grid; }
.pay-modal {
  background: #fff; border-radius: 16px;
  padding: 36px 40px; text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
}
.pay-spinner {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 4px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: pay-spin 0.8s linear infinite;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }
.pay-modal h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.pay-modal p { font-size: 0.86rem; color: var(--text-light); }

/* ============================================================
   Success page
   ============================================================ */
.success-card {
  max-width: 620px; margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 40px 32px 36px;
  text-align: center;
}
.success-check {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%;
  background: #16a34a;
  display: grid; place-items: center;
  color: #fff; font-size: 1.9rem;
}
.success-card h1 { font-size: 1.5rem; font-weight: 800; }
.success-card .sub { color: var(--text-mid); font-size: 0.95rem; margin-top: 8px; }
.success-email { font-weight: 700; color: var(--text); }

.qr-box {
  margin: 26px auto 8px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  max-width: 320px;
}
.qr-box img { width: 200px; height: 200px; margin: 0 auto 12px; background: #fff; border-radius: 8px; padding: 8px; }
.qr-box .qr-note { font-size: 0.82rem; color: var(--text-light); }
.qr-mock-tag {
  display: inline-block; margin-top: 10px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--star); background: #fff7e6; border: 1px solid #f5d98a;
  padding: 3px 9px; border-radius: 5px;
}

.order-summary {
  text-align: left;
  margin: 24px auto 0; max-width: 380px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.order-summary .order-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 0.9rem; }
.order-summary .order-row .k { color: var(--text-light); }
.order-summary .order-row .v { font-weight: 700; }
.order-summary .order-row--total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 1rem; }

.success-steps { text-align: left; max-width: 420px; margin: 26px auto 0; }
.success-steps h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; text-align: center; }
.success-steps ol { counter-reset: s; list-style: none; }
.success-steps li {
  counter-increment: s;
  position: relative;
  padding: 8px 0 8px 38px;
  font-size: 0.9rem; color: var(--text-mid);
}
.success-steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 6px;
  width: 24px; height: 24px;
  background: var(--red-light); color: var(--red);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700;
}
.success-actions { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-outline {
  border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 22px; font-weight: 600; font-size: 0.9rem;
  color: var(--text); background: #fff; transition: var(--transition);
}
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-solid {
  border: none; border-radius: 9px;
  padding: 12px 24px; font-weight: 700; font-size: 0.9rem;
  color: #fff; background: var(--red); transition: var(--transition);
}
.btn-solid:hover { background: var(--red-dark); }

/* ============================================================
   My eSIMs — customer portal
   ============================================================ */
.portal { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.portal__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.portal__title { font-size: 1.18rem; font-weight: 800; color: var(--text); }
.portal__email { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }
.portal__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.88rem; font-weight: 600; color: var(--text-mid);
  white-space: nowrap;
}
.portal__back:hover { color: var(--red); }

.esim-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.esim-card__top { display: flex; align-items: center; gap: 12px; }
.esim-flag {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center;
  overflow: hidden;
}
.esim-flag::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--red);
}
.esim-card__name { font-size: 1rem; font-weight: 800; color: var(--text); }
.esim-card__plan { font-size: 0.83rem; color: var(--text-light); margin-top: 1px; }
.esim-status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.76rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
}
.esim-status--active  { background: #e7f8ef; color: #16a34a; }
.esim-status--expired { background: #fdeaea; color: var(--red); }

.esim-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  border-top: 1px solid var(--border);
  margin-top: 16px; padding-top: 16px;
}
.esim-meta__k {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-light);
}
.esim-meta__v { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-top: 3px; }

.esim-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--bg-light); border-radius: 9px;
  padding: 11px 13px; margin-top: 16px;
  font-size: 0.83rem; color: var(--text-mid);
}
.esim-note .i { color: var(--text-light); flex-shrink: 0; }

.esim-actions { display: flex; gap: 12px; margin-top: 16px; }
.esim-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 12px 10px; cursor: pointer; transition: var(--transition);
}
.esim-btn:hover { border-color: var(--red); color: var(--red); }
.esim-btn--full { flex: 1 1 100%; }

.portal-empty { text-align: center; color: var(--text-light); padding: 40px 0; }
.portal-empty a { color: var(--red); font-weight: 600; }

/* QR modal (reissue) */
.qr-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(20,24,40,0.55);
  display: none; place-items: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.qr-modal-overlay.show { display: grid; }
.qr-modal {
  background: #fff; border-radius: 16px;
  padding: 28px 26px; text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 340px; width: 100%;
  position: relative;
}
.qr-modal__close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; font-size: 1.3rem; color: var(--text-light);
  cursor: pointer; line-height: 1;
}
.qr-modal h3 { font-size: 1.05rem; font-weight: 800; }
.qr-modal .qr-modal__sub { font-size: 0.82rem; color: var(--text-light); margin-top: 4px; }
.qr-modal canvas { width: 200px; height: 200px; margin: 18px auto 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }   /* summary first on mobile */
  .step__line { width: 48px; }
}
@media (max-width: 520px) {
  .co-row { grid-template-columns: 1fr; gap: 0; }
  .checkout-main { padding-top: 92px; }
  .step__label { display: none; }
  .step__line { width: 36px; }
  .success-card { padding: 30px 20px; }
}
