/* Checkout, payment processing and payment-success styles.
   Everything is scoped to .co-* / .ps-* classes or page-only ids so the
   shared Tailwind build and other pages are unaffected. checkout.js and the
   payment-success script toggle Tailwind's .hidden and inline display, so no
   rule here sets display on an element those scripts show or hide. */
:root {
  --co-ink: #151b35;
  --co-muted: #526078;
  --co-soft: #8a93a8;
  --co-line: #e5e7ef;
  --co-bg: #f6f7fb;
  --co-brand: #4f46e5;
  --co-brand-dark: #4338ca;
  --co-brand-soft: #eef0ff;
  --co-ok: #047857;
  --co-ok-soft: #ecfdf5;
  --co-radius: 16px;
}

body.co-body { background: var(--co-bg); color: var(--co-ink); }

/* ---------- Page frame ---------- */
.co-page { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }
.co-head { margin-bottom: 24px; }
.co-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 13px; font-weight: 600; color: var(--co-soft); }
.co-steps li { display: inline-flex; align-items: center; gap: 8px; }
.co-steps li + li::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--co-line); }
.co-step-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1.5px solid var(--co-line); font-size: 11px; color: var(--co-soft); }
.co-steps .is-done { color: var(--co-ok); }
.co-steps .is-done .co-step-dot { background: var(--co-ok-soft); border-color: #a7f3d0; color: var(--co-ok); }
.co-steps .is-current { color: var(--co-ink); }
.co-steps .is-current .co-step-dot { background: var(--co-brand); border-color: var(--co-brand); color: #fff; }
.co-title { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; font-weight: 750; letter-spacing: -.025em; color: var(--co-ink); }
.co-lede { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--co-muted); }

.co-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "pay" "extras"; }
.co-pay { grid-area: pay; }
.co-summary { grid-area: summary; }
.co-extras { grid-area: extras; }
/* The second row takes the payment card's extra height, so the extras card
   sits directly under the summary instead of being pushed down. */
@media (min-width: 960px) {
  .co-grid { grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto 1fr; grid-template-areas: "pay summary" "pay extras"; align-items: start; column-gap: 32px; row-gap: 20px; }
}

.co-card { background: #fff; border: 1px solid var(--co-line); border-radius: var(--co-radius); box-shadow: 0 1px 2px rgba(21, 27, 53, .04), 0 8px 24px rgba(21, 27, 53, .04); padding: 24px; }
@media (min-width: 640px) { .co-card { padding: 28px; } }
.co-card-title { margin: 0 0 20px; font-size: 19px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--co-ink); }

/* ---------- Payment column ---------- */
.co-section-label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--co-muted); }
.co-section-label span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--co-brand-soft); color: var(--co-brand); font-size: 12px; letter-spacing: 0; }
.co-fields { display: grid; gap: 16px; }
@media (min-width: 640px) { .co-fields { grid-template-columns: 1fr 1fr; } }
.co-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--co-ink); }
.co-input { display: block; width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #d5d9e4; border-radius: 10px; background: #fff; font-size: 16px; color: var(--co-ink); box-shadow: 0 1px 2px rgba(21, 27, 53, .04); transition: border-color .15s ease, box-shadow .15s ease; }
.co-input:hover { border-color: #b9bfd0; }
.co-input:focus { outline: none; border-color: var(--co-brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .18); }
.co-input[readonly] { background: #f8f9fc; color: var(--co-muted); }
.co-hint { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--co-muted); }
.co-divider { height: 1px; margin: 28px 0 24px; background: var(--co-line); border: 0; }

.co-element { min-height: 40px; }
#card-errors:empty { display: none; }

.co-legal { margin: 20px 0 0; font-size: 12px; line-height: 1.55; color: var(--co-soft); }
.co-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.co-terms { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--co-line); border-radius: 12px; background: #fafbfd; cursor: pointer; }
.co-terms input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--co-brand); cursor: pointer; }
.co-terms label { font-size: 14px; line-height: 1.5; color: var(--co-ink); cursor: pointer; }
.co-terms a { color: var(--co-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.co-terms.is-invalid { border-color: #fca5a5; background: #fef2f2; }
.co-terms-error { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: #b91c1c; }

.co-submit { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; margin-top: 22px; padding: 14px 20px; border: 0; border-radius: 12px; background: var(--co-brand); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .005em; box-shadow: 0 6px 16px rgba(79, 70, 229, .28); cursor: pointer; transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
/* checkout.js replaces the button's contents while processing, so the lock
   is a pseudo-element rather than markup it would discard. */
.co-submit::before { content: ""; width: 16px; height: 16px; flex: 0 0 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5zm-3 8V7a3 3 0 1 1 6 0v3H9z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5zm-3 8V7a3 3 0 1 1 6 0v3H9z'/%3E%3C/svg%3E") center / contain no-repeat; }
.co-submit:disabled::before { display: none; }
.co-submit:hover:not(:disabled) { background: var(--co-brand-dark); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79, 70, 229, .32); }
.co-submit:focus-visible { outline: 3px solid var(--co-brand); outline-offset: 3px; }
.co-submit:disabled { opacity: .75; cursor: progress; transform: none; }
.co-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--co-muted); text-decoration: none; }
.co-back:hover { color: var(--co-brand); }

.co-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 0; color: var(--co-muted); font-size: 15px; }
.co-spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--co-brand-soft); border-top-color: var(--co-brand); animation: co-spin .8s linear infinite; }
@keyframes co-spin { to { transform: rotate(360deg); } }

/* Trust block under the form */
.co-trust { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--co-line); }
.co-trust-row .co-methods { flex: 1 1 100%; }
.co-trust-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.co-stripe { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--co-muted); }
.co-stripe img { width: 20px; height: 20px; border-radius: 5px; }
.co-stripe strong { color: #635bff; }
.co-assurances { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.co-assurances li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--co-muted); }
.co-assurances svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; color: var(--co-ok); }

/* ---------- Summary column ---------- */
.co-product { display: flex; align-items: center; gap: 14px; }
.co-flags { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 56px; width: 56px; height: 56px; border-radius: 14px; background: var(--co-brand-soft); }
.co-flags img { width: 36px !important; height: 36px !important; object-fit: cover; }
.co-product-name { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; color: var(--co-ink); }
.co-product-desc { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--co-muted); }
.co-product-desc:empty { display: none; }
.co-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 0; }
.co-specs > div { padding: 12px 10px; border-radius: 12px; background: var(--co-bg); text-align: center; }
.co-specs dt { margin: 0; font-size: 12px; font-weight: 600; color: var(--co-muted); }
.co-specs dd { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--co-ink); overflow-wrap: anywhere; }

.co-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--co-line); }
.co-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.co-row h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--co-ink); }
.co-link-btn { min-height: 36px; padding: 0 4px; border: 0; background: none; font-size: 14px; font-weight: 700; color: var(--co-brand); cursor: pointer; }
.co-link-btn:hover { color: var(--co-brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.co-discount-form { display: flex; gap: 8px; margin-top: 12px; }
.co-discount-form .co-input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.co-discount-form .co-input::placeholder { text-transform: none; letter-spacing: 0; }
.co-apply { flex: 0 0 auto; min-height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--co-ink); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.co-apply:hover { background: #2a3254; }
.co-apply:disabled { opacity: .7; cursor: progress; }
#discount-message:not(.hidden) { margin-top: 10px; border-radius: 10px; }
.co-applied { margin-top: 12px; padding: 12px 14px; border: 1px solid #a7f3d0; border-radius: 12px; background: var(--co-ok-soft); }
.co-applied p { margin: 0; font-size: 13px; line-height: 1.45; color: #065f46; }
.co-applied p + p { margin-top: 2px; }
.co-applied strong { font-weight: 700; }
.co-applied button { min-height: 36px; border: 0; background: none; font-size: 13px; font-weight: 700; color: #065f46; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.co-currency { display: flex; align-items: flex-start; gap: 10px; }
.co-currency svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; color: var(--co-brand); }
.co-currency p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--co-muted); }
.co-currency .co-currency-main { font-weight: 600; color: var(--co-ink); }

.co-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.co-total-label { margin: 0; font-size: 15px; font-weight: 700; color: var(--co-ink); }
.co-total-note { margin: 2px 0 0; font-size: 12px; color: var(--co-soft); }
.co-total .price-container { text-align: end; }
.co-total .price { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--co-ink); }
.co-total #price-breakdown p { margin: 2px 0 0; }

.co-perks { display: grid; gap: 8px; margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--co-brand-soft); list-style: none; }
.co-perks li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: #312e81; }
.co-perks svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; color: var(--co-brand); }

.co-app { margin-top: 18px; }
.co-app p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--co-muted); }
.co-app p strong { display: block; font-size: 14px; color: var(--co-ink); }
.co-app .app-download-badges { gap: 10px; }
.co-app .app-store-link { flex-basis: 135px; width: 135px; height: 40px; }
.co-app .app-store-link img { width: 135px; height: 40px; }
.co-app .app-store-link--google img { width: 153.9px; height: 59.56px; left: -9.76px; top: -9.76px; }

/* ---------- Processing modal ---------- */
.co-modal { position: fixed; inset: 0; z-index: 1100; align-items: center; justify-content: center; padding: 20px; background: rgba(21, 27, 53, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.co-modal:not(.hidden) { display: flex; }
.co-modal-card { width: 100%; max-width: 380px; padding: 32px 28px 26px; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(21, 27, 53, .28); text-align: center; animation: co-pop .22s ease-out; }
@keyframes co-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.co-modal-icon { position: relative; width: 64px; height: 64px; margin: 0 auto 18px; }
.co-modal-icon .co-spinner { position: absolute; inset: 0; width: 64px; height: 64px; border-width: 4px; }
.co-modal-icon svg { position: absolute; inset: 20px; width: 24px; height: 24px; color: var(--co-brand); }
.co-modal-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--co-ink); }
.co-modal-body { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--co-muted); }
.co-modal-foot { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; padding: 6px 12px; border-radius: 999px; background: var(--co-bg); font-size: 12px; font-weight: 600; color: var(--co-muted); }
.co-modal-foot svg { width: 14px; height: 14px; color: var(--co-ok); }

/* ---------- Payment success / provisioning ---------- */
.ps-page { max-width: 880px; margin: 0 auto; padding: 32px 20px 56px; }
.ps-card { padding: 32px 24px; background: #fff; border: 1px solid var(--co-line); border-radius: 20px; box-shadow: 0 1px 2px rgba(21, 27, 53, .04), 0 12px 32px rgba(21, 27, 53, .05); text-align: center; }
@media (min-width: 640px) { .ps-card { padding: 40px; } }
.ps-page #headerIcon { width: 72px; height: 72px; margin-bottom: 18px; box-shadow: 0 0 0 8px rgba(255, 255, 255, .9), 0 0 0 9px var(--co-line); }
.ps-page #headerIcon svg { width: 34px; height: 34px; }
.ps-page #headerTitle { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; font-weight: 750; letter-spacing: -.02em; color: var(--co-ink); }
.ps-page #headerSubtitle { max-width: 34em; margin: 0 auto; font-size: 15px; line-height: 1.55; color: var(--co-muted); }
.ps-page #progressSection { max-width: 520px; margin-inline: auto; }
.ps-page .progress-bar { height: 8px; border-radius: 999px; background: var(--co-brand-soft); }
.ps-page .progress-bar-fill { border-radius: 999px; background: linear-gradient(90deg, var(--co-brand), #7c73ff); }
.ps-page #progressStatus, .ps-page #progressText { font-weight: 600; }
.ps-page #orderStatus .loading { width: 40px; height: 40px; border-width: 3px; }
.ps-page #statusMessage { font-size: 16px; font-weight: 650; color: var(--co-ink); }
.ps-page #actionButtons { flex-wrap: wrap; gap: 10px; }
.ps-page #actionButtons > * { margin: 0 !important; }
.ps-page #actionButtons button { min-height: 46px; padding-inline: 22px; border-radius: 10px; font-weight: 700; }

.ps-page #esimDetails { text-align: start; }
.ps-esim { display: grid; gap: 20px; margin-top: 16px; padding: 20px; border: 1px solid var(--co-line); border-radius: 16px; background: var(--co-bg); }
@media (min-width: 720px) { .ps-esim { grid-template-columns: 220px minmax(0, 1fr); align-items: center; } }
.ps-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--co-line); }
.ps-qr img { width: 180px; height: 180px; }
.ps-qr span { font-size: 12px; font-weight: 600; color: var(--co-muted); }
.ps-codes { display: grid; gap: 14px; }
.ps-codes label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--co-muted); }
.ps-copy { display: flex; gap: 8px; }
.ps-copy input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #d5d9e4; border-radius: 10px; background: #fff; font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--co-ink); }
.ps-copy button { flex: 0 0 auto; min-width: 76px; min-height: 44px; padding: 0 14px; border: 1px solid #d5d9e4; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 700; color: var(--co-ink); cursor: pointer; }
.ps-copy button:hover { border-color: var(--co-brand); color: var(--co-brand); }

.ps-install { margin-top: 28px; padding: 24px; border: 1px solid #dedbfb; border-radius: 16px; background: linear-gradient(180deg, #f6f5ff, #fff 60%); }
.ps-install .installation-tab { min-height: 44px; }
.ps-install details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.ps-install details summary::-webkit-details-marker { display: none; }
.ps-install details summary::after { content: ""; width: 10px; height: 10px; flex: 0 0 10px; border-right: 2px solid var(--co-muted); border-bottom: 2px solid var(--co-muted); transform: rotate(45deg) translateY(-3px); transition: transform .15s ease; }
.ps-install details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.ps-tips { margin: 0; padding-inline-start: 18px; list-style: disc; }
.ps-tips li + li { margin-top: 4px; }

/* App promotion card */
.ps-app { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 24px; border: 1px solid #dedbfb; border-radius: 20px; background: radial-gradient(ellipse at 0 0, #e5e7ff, transparent 70%), #f4f2ff; text-align: start; }
.ps-app-copy { display: flex; align-items: center; gap: 16px; flex: 1 1 300px; min-width: 0; }
.ps-app-copy img { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(49, 46, 129, .08); }
.ps-app-eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 750; letter-spacing: .09em; color: var(--co-brand); }
.ps-app h2 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 750; color: var(--co-ink); }
.ps-app-body { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--co-muted); }

.ps-help { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 14px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--co-line); font-size: 14px; color: var(--co-muted); }
.ps-help svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--co-brand); }
.ps-help a { font-weight: 700; color: var(--co-brand); }

@media (max-width: 480px) {
  .co-steps { gap: 6px; font-size: 12px; }
  .co-steps li { gap: 6px; }
  .co-steps li + li::before { width: 12px; }
  .co-step-dot { width: 20px; height: 20px; }
}
@media (max-width: 420px) {
  .co-page, .ps-page { padding-inline: 16px; }
  .co-card { padding: 20px 16px; }
  .co-specs dd { font-size: 14px; }
  .ps-install, .ps-app { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .co-spinner, .ps-page .loading { animation-duration: 2.4s; }
  .co-modal-card { animation: none; }
  .co-submit, .co-submit:hover:not(:disabled) { transition: none; transform: none; }
}
