:root {
  --navy: #003767;
  --navy-2: #00518F;
  --navy-3: #012B50;
  --cyan: #00A8E1;
  --ice: #EAF7FD;
  --ice-2: #D6EFF7;
  --ink: #0f2a43;
  --muted: #5a7389;
  --faint: #8aa0b2;
  --line: #dbe7f0;
  --line-2: #c4d6e3;
  --bg: #f3f7fa;
  --error: #b42318;
  --error-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(1, 43, 80, .05), 0 4px 16px rgba(1, 43, 80, .06);
  --shadow-active: 0 2px 4px rgba(1, 43, 80, .06), 0 12px 32px rgba(1, 43, 80, .10);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- masthead ---------- */
.masthead {
  background-color: var(--navy);
  background-image: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 52%, var(--navy-3) 100%);
  color: #fff;
  padding: 18px 0 22px;
}
.masthead-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: block; width: 190px; height: auto; }
.secure-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ice-2);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.secure-pill .ico { width: 15px; height: 15px; color: var(--cyan); }
.masthead h1 { margin: 16px 0 2px; font-size: clamp(22px, 3.2vw, 28px); line-height: 1.25; letter-spacing: -0.015em; }
.subtitle { margin: 0; color: var(--ice-2); font-size: 15px; }
.subtitle:empty { display: none; }
.seam { height: 3px; background: var(--cyan); }

/* ---------- layout ---------- */
main.wrap { padding-top: 24px; padding-bottom: 40px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.col-side { position: sticky; top: 16px; }

.notice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; color: var(--muted); display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.notice-error { color: var(--error); border-color: #fecdca; background: var(--error-bg); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ice-2); border-top-color: var(--navy); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- steps (accordion) ---------- */
.step-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), opacity .25s var(--ease);
}
.step-card.is-active { border-color: var(--line-2); box-shadow: var(--shadow-active); }
.step-card.is-locked { box-shadow: none; background: rgba(255, 255, 255, .6); }

.step-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; min-height: 68px; }
.step-card.is-done:not(.is-active) .step-head { cursor: pointer; }
.step-card.is-done:not(.is-active) .step-head:hover h2 { color: var(--navy-2); }
.step-titles { flex: 1; min-width: 0; }
.step-head h2 { margin: 0; font-size: 17px; line-height: 1.3; color: var(--navy); letter-spacing: -0.01em; transition: color .15s; }
.step-card.is-locked h2 { color: var(--faint); }
.step-summary { margin: 2px 0 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-summary:empty, .step-card.is-active .step-summary, .step-card.is-locked .step-summary { display: none; }

.step-num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 700;
  background: var(--navy); color: #fff;
  transition: background .25s var(--ease), color .25s var(--ease), transform .3s var(--ease);
}
.step-num .ico { display: none; width: 16px; height: 16px; }
.step-card.is-locked .step-num { background: #fff; color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.step-card.is-done:not(.is-active) .step-num { background: var(--ok); }
.step-card.is-done:not(.is-active) .step-num .n { display: none; }
.step-card.is-done:not(.is-active) .step-num .ico { display: block; animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.step-edit {
  display: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--navy);
  background: none; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; min-height: 36px;
}
.step-edit:hover { background: var(--ice); border-color: var(--cyan); }
.step-card.is-done:not(.is-active) .step-edit { display: inline-block; }

.step-body { display: none; padding: 0 22px 22px 66px; }
.step-card.is-active .step-body { display: block; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } }

.step-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.step-actions .btn-primary { width: auto; min-width: 220px; }
.step-error { margin: 12px 0 0; color: var(--error); font-size: 14px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- fields ---------- */
.hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.hint:empty { display: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span2 { grid-column: 1 / -1; }

label, .label-text { display: block; font-size: 14px; font-weight: 600; color: var(--navy); }
.opt { font-weight: 400; color: var(--faint); font-size: 13px; }
input, select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 16px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%235a7389' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input:hover, select:hover { border-color: #a9c2d4; }
input:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 168, 225, .25); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180, 35, 24, .10); }
input[readonly] { background: #f4f8fb; color: var(--muted); }
.field-hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 6px; }
.field-error { display: block; font-weight: 600; font-size: 13px; color: var(--error); margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.toggle-row { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink); margin: 0 0 16px; cursor: pointer; }
.toggle-row input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--navy); box-shadow: none; }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--ice); border-radius: 10px;
  padding: 14px 16px; margin: 0 0 18px;
  color: var(--navy); font-size: 14px;
}
.callout .ico { color: var(--navy-2); margin-top: 1px; }
.callout p { margin: 0; }

/* ---------- course options ---------- */
.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  padding: 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.option:hover { border-color: #a9d8ec; }
.option.selected { border-color: var(--navy); background: linear-gradient(0deg, #f6fbfe, #f6fbfe); box-shadow: 0 0 0 3px rgba(0, 168, 225, .12); }
.option > input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--navy); grid-row: span 2; align-self: start; margin-top: 1px; box-shadow: none; }
.option .name { font-weight: 650; color: var(--navy); line-height: 1.35; }
.option .price { font-weight: 650; white-space: nowrap; color: var(--ink); }
.option .price small { font-weight: 400; color: var(--muted); font-size: 13px; }
.option .desc { grid-column: 2 / -1; font-size: 13.5px; color: var(--muted); }
.option .desc:empty { display: none; }
.option .qty-row { grid-column: 2 / -1; display: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.option.selected .qty-row { display: flex; }
.qty-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.qty-line { font-weight: 650; color: var(--navy); font-size: 15px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; margin-left: 10px; vertical-align: middle; }
.qty-stepper button { width: 38px; height: 38px; border: 0; background: #fff; color: var(--navy); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.qty-stepper button:hover:not(:disabled) { background: var(--ice); }
.qty-stepper button:disabled { color: #c3d2dd; cursor: default; }
.qty-stepper input { width: 48px; min-height: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-weight: 650; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input:focus { box-shadow: inset 0 0 0 2px var(--cyan); }

/* ---------- several learners ---------- */
.later { border: 1.5px solid var(--ice-2); background: #f7fcfe; border-radius: 12px; padding: 18px 20px; }
.later-title { margin: 0 0 12px; font-weight: 700; color: var(--navy); font-size: 16px; }
.later-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.later-steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 12px; font-size: 14px; color: var(--ink); }
.later-steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.later-steps strong { color: var(--navy); }

/* ---------- payment ---------- */
.secure-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin: 0 0 18px;
  border-radius: 10px; background: var(--ok-bg); border: 1px solid #c6f0d8;
  font-size: 13.5px; color: #0b4a33;
}
.secure-banner .ico { width: 22px; height: 22px; color: var(--ok); }
.secure-banner strong { display: block; font-size: 14.5px; color: #05603a; margin-bottom: 2px; }
.card-element { margin-top: 6px; min-height: 46px; }
.card-element .recurly-element { margin-top: 0; height: 46px; border-radius: 10px; border: 1px solid var(--line-2); }
.card-element .recurly-element-focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 168, 225, .25); }
.card-element .recurly-element-invalid { border-color: var(--error); }
.card-placeholder { height: 46px; border: 1px dashed var(--line-2); border-radius: 10px; display: flex; align-items: center; padding: 0 12px; color: var(--faint); font-size: 14px; }

.finish { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-body > .finish:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.accept { margin-bottom: 14px; }
.fine { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn-primary, .btn-secondary { font: inherit; font-weight: 700; border: 0; border-radius: 10px; cursor: pointer; min-height: 48px; }
.btn-primary {
  width: 100%; padding: 12px 22px; color: #fff; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background-color: var(--navy);
  background-image: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 52%, var(--navy-3) 100%);
  box-shadow: 0 1px 2px rgba(1, 43, 80, .2), 0 4px 12px rgba(0, 55, 103, .18);
  transition: transform .12s var(--ease), box-shadow .15s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 2px 4px rgba(1, 43, 80, .2), 0 8px 20px rgba(0, 55, 103, .22); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn-primary:disabled { opacity: .7; cursor: progress; transform: none; }
.btn-pay { font-size: 17px; min-height: 54px; }
.btn-pay .ico { width: 18px; height: 18px; color: var(--cyan); }
.btn-pay.busy .ico { display: none; }
.btn-pay.busy::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn-secondary { padding: 0 16px; background: #fff; color: var(--navy); border: 1px solid var(--line-2); }
.btn-secondary:hover { background: var(--ice); }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: 10px; font: inherit; }

.form-error { background: var(--error-bg); color: var(--error); border: 1px solid #fecdca; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

/* ---------- summary ---------- */
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.summary h2 { margin: 0 0 14px; font-size: 17px; color: var(--navy); }
.summary-toggle { display: none; }
.lines { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.line span:last-child { white-space: nowrap; font-weight: 600; }
.line .qty-note { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.line.discount { color: var(--ok); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 12px; }
.people { font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.people:empty { display: none; }
.people div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.people strong { color: var(--navy); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { margin: 0; text-transform: uppercase; }
.coupon-row input::placeholder { text-transform: none; }
.coupon-msg { margin: 6px 0 0; font-size: 13px; }
.coupon-msg:empty { display: none; }
.coupon-msg.ok { color: var(--ok); font-weight: 600; }
.coupon-msg.err { color: var(--error); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 4px; font-size: 15px; color: var(--navy); font-weight: 600; }
.total-row strong { font-size: 26px; letter-spacing: -0.02em; }
.trust { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.trust .ico { width: 20px; height: 20px; color: var(--ok); }
.trust strong { display: block; color: var(--ink); font-size: 13.5px; }
.help { margin: 14px 4px 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- 3-D Secure ---------- */
.modal { position: fixed; inset: 0; background: rgba(1, 43, 80, .55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-body { background: #fff; border-radius: var(--radius); padding: 24px; width: min(520px, 100%); max-height: 92vh; overflow: auto; text-align: center; box-shadow: var(--shadow-active); }
.modal-body h2 { margin: 0 0 6px; color: var(--navy); }
.tds-frame { min-height: 0; margin-top: 12px; }
.tds-frame:not(:empty) { min-height: 420px; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .col-side { position: static; order: -1; margin-bottom: 12px; }
  .summary-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
    font: inherit; font-size: 15px; color: var(--navy); font-weight: 600;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 18px; min-height: 52px; cursor: pointer; box-shadow: var(--shadow);
  }
  .summary-toggle strong { font-size: 17px; }
  .st-left { display: inline-flex; align-items: center; gap: 6px; }
  .chev { transition: transform .2s var(--ease); color: var(--muted); }
  .col-side.open .chev { transform: rotate(180deg); }
  .col-side.open .summary-toggle { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; box-shadow: none; }
  .summary { display: none; border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; padding-top: 4px; }
  .col-side.open .summary { display: block; animation: rise .25s var(--ease); }
  .summary h2 { display: none; }
  .help { display: none; }
}
@media (max-width: 560px) {
  .masthead { padding: 14px 0 18px; }
  .logo { width: 150px; }
  .secure-pill { font-size: 12px; padding: 5px 10px; }
  .masthead h1 { margin-top: 12px; }
  main.wrap { padding-top: 14px; }
  .step-head { padding: 16px; gap: 12px; min-height: 60px; }
  .step-body { padding: 0 16px 18px; }
  .grid { gap: 12px; }
  .grid > label:has(input[type=email]), .grid > label:has(input[type=tel]) { grid-column: 1 / -1; }
  .step-actions .btn-primary { width: 100%; }
  .option { padding: 14px; gap: 4px 12px; }
  .option .qty-row { flex-wrap: wrap; }
}
