/* ==========================================================================
   HAYORMIDEY (Training & Consulting)
   AI for Finance Professionals Training — Application Form
   --------------------------------------------------------------------------
   DESIGN TOKENS
   Color   : Ink #0F1B2D (navy, trust/finance) · Paper #F6F4EE (warm ledger)
             Brass #B8892B (accent, precision) · Emerald #1F6F54 (growth/confirm)
             Ink-60 #4A5568 (secondary text) · Line #DDD6C4 (hairline)
   Type    : Fraunces (display/serif, headings) + Inter (ui/body, sans)
   Layout  : Single centered column, ledger-style numbered steps,
             generous whitespace, left-aligned content.
   ========================================================================== */

:root {
  --ink: #0F1B2D;
  --ink-60: #4A5568;
  --ink-40: #7A8494;
  --paper: #F6F4EE;
  --paper-raised: #FFFFFF;
  --brass: #B8892B;
  --brass-dark: #93701F;
  --emerald: #1F6F54;
  --line: #DDD6C4;
  --line-soft: #E9E4D6;
  --danger: #B3402A;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.06);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* ===================== TOP BAR ===================== */
.topbar {
  background: var(--ink);
  color: #EDE8DA;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #EDE8DA;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--brass);
  color: var(--brass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 14.5px; letter-spacing: 0.02em; }
.brand__text small { font-size: 11.5px; color: #B9B2A0; }
.topbar__back {
  font-size: 13.5px;
  color: #C9C2AF;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.topbar__back:hover { border-bottom-color: #C9C2AF; }

/* ===================== HERO ===================== */
.hero {
  background: var(--ink);
  color: #EDE8DA;
  padding: 44px 0 56px;
  border-bottom: 3px solid var(--brass);
}
.hero__inner { max-width: 640px; }
.pill {
  display: inline-block;
  font-size: 12.5px;
  color: var(--brass);
  border: 1px solid rgba(184, 137, 43, 0.55);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: #FFFFFF;
}
.hero__lead {
  font-size: 16px;
  color: #C9C2AF;
  max-width: 54ch;
  margin: 0 0 28px;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(237, 232, 218, 0.15);
}
.hero__meta-item { display: flex; flex-direction: column; gap: 4px; }
.hero__meta-label { font-size: 11.5px; color: #8C93A0; }
.hero__meta-value { font-size: 14px; color: #EDE8DA; font-weight: 500; }

/* ===================== FORM WRAP ===================== */
.form-wrap {
  padding: 40px 24px 80px;
}

/* ---- progress ---- */
.progress { margin-bottom: 36px; }
.progress__bar {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress__fill {
  height: 100%;
  width: 16.6667%;
  background: var(--brass);
  transition: width 0.35s ease;
}
.progress__steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--ink-40);
}
.progress__steps li {
  padding: 3px 0;
  position: relative;
}
.progress__steps li:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 12px;
  border-bottom: 1px solid var(--line);
  margin: 0 6px;
  vertical-align: middle;
}
.progress__steps li.is-active { color: var(--ink); font-weight: 600; }
.progress__steps li.is-done { color: var(--emerald); }

/* ---- alert ---- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14.5px;
  margin-bottom: 24px;
  border: 1px solid transparent;
}
.alert.alert--error {
  background: #FBEDE9;
  border-color: #E4B9AC;
  color: var(--danger);
}
.alert.alert--success {
  background: #EAF3EF;
  border-color: #B9D9CC;
  color: var(--emerald);
}

/* ---- honeypot (hidden from real users) ---- */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ---- fieldset / steps ---- */
form { margin: 0; }
fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: none;
}
fieldset.is-active { display: block; animation: stepIn 0.28s ease; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

legend {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 0 0 26px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.step-index {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--brass);
  line-height: 1;
  padding-top: 3px;
  flex-shrink: 0;
}
legend h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--ink);
}
legend p {
  margin: 0;
  color: var(--ink-60);
  font-size: 14.5px;
}

/* ---- grid / fields ---- */
.grid { display: grid; gap: 20px 20px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--1 { grid-template-columns: 1fr; }
.grid__full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.field label em {
  font-style: normal;
  color: var(--brass-dark);
  margin-left: 2px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 96px; font-family: var(--font-ui); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(184, 137, 43, 0.22);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
}

.field__error {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 1px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' stroke='%234A5568' stroke-width='1.6' fill='none' fill-rule='evenodd'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

/* ---- course cards ---- */
.course-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.course-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 18px 16px;
  cursor: pointer;
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.course-card input { position: absolute; opacity: 0; pointer-events: none; }
.course-card__body { display: flex; flex-direction: column; gap: 6px; }
.course-card__title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}
.course-card__desc { font-size: 13px; color: var(--ink-60); }
.course-card:has(input:checked) {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(184, 137, 43, 0.16);
  background: #FBF7EC;
}

/* ---- radio pills / checkbox ---- */
.radio-row { display: flex; gap: 10px; }
.radio-pill {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--paper-raised);
}
.radio-pill input { accent-color: var(--brass); }
.radio-pill:has(input:checked) {
  border-color: var(--brass);
  background: #FBF7EC;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--ink);
}
.checkbox-row input {
  margin-top: 3px;
  accent-color: var(--brass);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.declaration { margin-top: 8px; }

/* ---- review box ---- */
.review-box {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  font-size: 14px;
}
.review-box__row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.review-box__row:last-child { border-bottom: none; }
.review-box__label { color: var(--ink-60); }
.review-box__value { color: var(--ink); font-weight: 500; word-break: break-word; }
.review-box__empty { color: var(--ink-40); }

/* ---- nav buttons ---- */
.form-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.btn {
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
  background: var(--ink);
  color: #F6F4EE;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn--primary:hover { background: #1a2c46; }
.btn--primary:active { transform: scale(0.98); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--ink-60);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink-40); color: var(--ink); }
.btn--ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.btn__spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(246, 244, 238, 0.35);
  border-top-color: #F6F4EE;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== FOOTER ===================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  text-align: center;
}
.site-footer p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--ink-40);
}
.site-footer a { color: var(--ink-60); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero { padding: 34px 0 42px; }
  .form-wrap { padding: 30px 18px 60px; }
  .grid--2 { grid-template-columns: 1fr; }
  .course-options { grid-template-columns: 1fr; }
  legend { gap: 12px; }
  .step-index { font-size: 21px; }
  legend h2 { font-size: 19px; }
  .review-box__row { grid-template-columns: 1fr; gap: 2px; }
  .form-nav { flex-wrap: wrap; }
  .btn { flex: 1; text-align: center; justify-content: center; }
  .btn--primary { margin-left: 0; }
  .topbar__inner { padding: 14px 18px; }
}

@media (max-width: 400px) {
  .radio-row { flex-direction: column; }
  .radio-pill { width: 100%; justify-content: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  fieldset.is-active { animation: none; }
  .btn--primary:active { transform: none; }
}

/* Fallback for browsers without :has() support: show all radio/course states plainly */
@supports not selector(:has(a)) {
  .course-card, .radio-pill { border-color: var(--line); }
}
