/* ==========================================================================
   Forge Academy — Register page
   Extends base/layout/components. Uses the same design tokens.
   ========================================================================== */

.reg-hero {
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
}

.reg-hero__intro {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.reg-hero__intro h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

.reg-hero__intro p {
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: var(--fs-body);
}

/* ---- Stepper ---- */
.stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 640px;
  margin: var(--space-4) auto var(--space-5);
}

.stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 90px;
}

.stepper__circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--color-line);
  background: #fff;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.stepper__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  text-align: center;
}

.stepper__label small {
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--color-muted);
  opacity: 0.8;
}

.stepper__line {
  flex: 1;
  height: 2px;
  background: var(--color-line);
  margin-top: 17px;
  position: relative;
  overflow: hidden;
}

.stepper__line span {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--color-orange-600);
  transition: width 0.35s var(--ease);
}

.stepper__step.is-done .stepper__circle {
  background: var(--color-teal-700);
  border-color: var(--color-teal-700);
  color: #fff;
}

.stepper__step.is-active .stepper__circle {
  background: var(--color-orange-600);
  border-color: var(--color-orange-600);
  color: #fff;
}

.stepper__step.is-active .stepper__label,
.stepper__step.is-done .stepper__label {
  color: var(--color-ink);
}

.stepper__line.is-filled span {
  width: 100%;
}
@media (max-width: 400px) {
  .stepper__step {
    min-width: 64px;
  }

  .stepper__label small {
    display: none;
  }

  .stepper__circle {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}

/* ---- Layout grid: main panel + order summary ---- */
.reg-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-3);
  align-items: start;
}

@media (max-width: 860px) {
  .reg-grid {
    grid-template-columns: 1fr;
  }

  .reg-grid > * {
    min-width: 0;
  }

  /* Put the form first on small screens; the summary follows it. */
  .reg-main {
    order: 0;
  }

  .order-summary {
    order: 1;
  }
}

.reg-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  animation: reg-fade-in 0.3s var(--ease);
}

@keyframes reg-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reg-card__head {
  margin-bottom: var(--space-3);
}

.reg-card__head p {
  color: var(--color-muted);
  margin-top: 0.3rem;
  font-size: 0.92rem;
}

.reg-card__head--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ---- Programme radio cards ---- */
.programme-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.programme-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.programme-option:hover {
  border-color: var(--color-teal-500);
}

.programme-option.is-selected {
  border-color: var(--color-teal-700);
  background: var(--color-teal-50);
}

.programme-option__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.programme-option__meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.programme-option__meta strong {
  font-size: 0.98rem;
  color: var(--color-ink);
}

.programme-option__tags {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

.programme-option__price {
  font-weight: 700;
  color: var(--color-ink);
  font-size: 0.95rem;
  white-space: nowrap;
}

.programme-option__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-weight: 700;
}

.programme-option__price-original {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: line-through;
}

.programme-option__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-line);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s var(--ease);
}

.programme-option.is-selected .programme-option__radio {
  border-color: var(--color-teal-700);
}

.programme-option.is-selected .programme-option__radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-teal-700);
}


.price-strike {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-decoration: line-through;
  margin-right: 6px;
  font-weight: 500;
}

.payment-method--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.payment-method--disabled input {
  cursor: not-allowed;
}

.bank-fields {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-teal-50);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: var(--space-2) 0;
}

.bank-fields.is-visible {
  display: flex;
}

.transfer-details__row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--color-line);
}

.transfer-details__row:last-child {
  border-bottom: none;
}

.transfer-status {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
}

.transfer-status--pending {
  background: var(--color-orange-100);
  color: var(--color-orange-700);
}

.transfer-status--error {
  background: #FDE8E8;
  color: #C0392B;
}

/* ---- Form fields ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink);
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-base);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-ink);
  transition: border-color 0.15s var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-teal-700);
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field-row {
  display: flex;
  gap: var(--space-2);
}

.field-row .field {
  flex: 1;
}

.field-note {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Referral ---- */
.referral-input-row {
  display: flex;
  gap: 0.6rem;
}

.referral-input-row input {
  flex: 1;
}

.referral-input-row .btn {
  padding: 0.7rem 1.3rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.referral-success {
  color: var(--color-teal-700);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.price-breakdown {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.price-breakdown__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--color-body);
}

.price-breakdown__row--discount {
  color: var(--color-teal-700);
}

.price-breakdown__row--total {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-ink);
  padding-top: 0.5rem;
  border-top: 1px dashed var(--color-line);
}

/* ---- Order summary sidebar ---- */
.order-summary {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  position: sticky;
  top: 6.5rem;
}
@media (max-width: 860px) {
  .order-summary {
    position: static;
    top: auto;
  }
}
.order-summary h3 {
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

.order-summary__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-line);
}

.order-summary__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-teal-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.order-summary__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.order-summary__meta strong {
  font-size: 0.92rem;
}

.order-summary__meta small {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.order-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--color-body);
  margin-bottom: 0.55rem;
}

.order-summary__row--total {
  font-weight: 700;
  color: var(--color-ink);
  font-size: 1.05rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-line);
}

.order-summary__notes {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.order-summary__notes li {
  font-size: 0.78rem;
  color: var(--color-muted);
  padding-left: 1.1rem;
  position: relative;
}

.order-summary__notes li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-teal-700);
  font-weight: 700;
}

/* ---- Action row ---- */
.reg-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.reg-actions--end {
  justify-content: flex-end;
}

.reg-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

@media (max-width: 480px) {
  .reg-actions {
    flex-direction: column;
  }

  .reg-actions .btn {
    width: 100%;
  }
}
/* ---- Student summary (step 4) ---- */
.student-summary {
  background: var(--color-teal-tint);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.student-summary__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.student-summary__head h3 {
  font-size: 0.95rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-teal-700);
  font-weight: 600;
  font-size: 0.85rem;
}

.student-summary__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.student-summary__grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.student-summary__grid span {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.student-summary__grid strong {
  font-size: 0.9rem;
  color: var(--color-ink);
  word-break: break-word;
}

/* ---- Payment methods ---- */
.payment-methods h3 {
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.payment-method:has(input:checked) {
  border-color: var(--color-teal-700);
  background: var(--color-teal-50);
}

.payment-method input {
  accent-color: var(--color-teal-700);
  width: 18px;
  height: 18px;
}

.payment-method__icon {
  font-size: 1.2rem;
}

.payment-method__label {
  display: flex;
  flex-direction: column;
}

.payment-method__label strong {
  font-size: 0.92rem;
}

.payment-method__label small {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.card-fields {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0.2rem var(--space-3);
  margin: -0.3rem 0 0.7rem;
}

.card-fields.is-visible {
  display: flex;
}

.card-fields .field-row {
  display: flex;
  gap: var(--space-2);
}
/* ---- Submit button loading spinner ---- */
.btn__spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn.is-loading {
  opacity: 0.85;
  cursor: progress;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn__spinner {
    animation-duration: 1.5s;
  }
}

/* ---- Success popup ---- */
.reg-success-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

/* Author rules always beat the UA stylesheet's [hidden]{display:none}, even
   with equal specificity — so `display: flex` above would otherwise win and
   the popup would show on load. This forces it hidden when the attribute is
   set; JS only ever toggles the attribute, never a class, to open/close it. */
.reg-success-modal[hidden] {
  display: none;
}

.reg-success-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 25, 0.55);
}

.reg-success-modal__dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  width: min(380px, 100%);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  animation: reg-success-in 0.25s var(--ease);
}

@keyframes reg-success-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reg-success-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-teal-100);
  color: var(--color-teal-700);
  margin-bottom: var(--space-2);
}

.reg-success-modal__dialog h2 {
  font-size: 1.25rem;
}

.reg-success-modal__dialog p {
  margin-top: 0.5rem;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.reg-success-modal__dialog .btn {
  width: 100%;
  margin-top: var(--space-3);
}

body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Responsive — tablet & phone
   ========================================================================== */

@media (max-width: 860px) {
  .reg-hero {
    padding-top: var(--space-3);
    padding-bottom: var(--space-5);
  }

  .reg-card {
    padding: var(--space-3);
  }
}

@media (max-width: 640px) {
  .stepper {
    margin-block: var(--space-3) var(--space-4);
  }

  .stepper__step {
    min-width: 72px;
  }

  .stepper__label {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .reg-card__head h2 {
    font-size: 1.3rem;
  }

  /* price breakdown / summary totals stay on one line */
  .price-breakdown__row--total {
    font-size: 1.05rem;
  }
}

@media (max-width: 460px) {
  .reg-card {
    padding: var(--space-3) var(--space-2);
  }

  /* Programme option: let the price drop to its own line under the title
     instead of squeezing four columns into ~280px. */
  .programme-option {
    flex-wrap: wrap;
    row-gap: 0.5rem;
    padding: 0.9rem 1rem;
  }

  .programme-option__meta {
    flex: 1 1 auto;
  }

  .programme-option__price {
    order: 3;
    flex-basis: 100%;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding-left: calc(40px + var(--space-2));
  }

  .programme-option__radio {
    order: 2;
  }

  .student-summary__grid {
    grid-template-columns: 1fr;
  }

  .transfer-details__row {
    gap: var(--space-2);
  }

  .transfer-details__row strong {
    text-align: right;
    word-break: break-word;
  }

  .referral-input-row {
    flex-wrap: wrap;
  }

  .referral-input-row .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .stepper__circle {
    width: 26px;
    height: 26px;
    font-size: 0.78rem;
  }
}
