/* ============================================================
   APPLY — paper-register career application form (/apply/:ref)

   Mirrors the brief paper register: cream background, finance-blue
   accent, serif headline + monospace meta. Body classes:
     body.theme-paper           — paper register active
     body screen--apply visible — current screen
   ============================================================ */

:root {
  /* Paper register (Register C) — these page-scoped tokens map onto
     canonical equivalents from main.css :root. The warm paper variant
     `--paper-warm` (#F6EFE1) is registered canonically; ink/rule reuse
     the canonical ink scale; the finance accent reuses --sec-finance.
     Task #488 Phase 4 cleanup. */
  --apply-paper:             var(--paper-warm);
  --apply-ink:               var(--ink);
  --apply-rule:              var(--ink-line);
  --apply-finance-blue:      var(--sec-finance);
  --apply-finance-blue-dark: #21408F;        /* legacy shadow of --brand-blue-dark */
  --apply-finance-blue-soft: rgba(46, 81, 181, 0.08);
  --apply-error:             var(--red);
  --apply-error-deep:        #7F1D1D;
  --apply-error-soft:        rgba(226, 75, 74, 0.08);
}

.screen--apply {
  background: var(--apply-paper);
  color: var(--apply-ink);
  min-height: 100vh;
  padding: 0;
}

/* On /apply/:ref the global persistent .nav (and its mobile burger)
   are hidden so this paper page renders with only its own thin
   apply-topbar — no dual chrome. body.route-apply is toggled by
   nav._applyTheme when the URL matches /apply/:ref. */
body.route-apply .nav,
body.route-apply .nav-burger { display: none !important; }

/* Paper-register topbar — the original nav is hidden on theme-paper
   routes and replaced by this thin bar so the document feels like a
   printed register, not a screen page. */
.apply-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--apply-rule);
  background: var(--apply-paper);
}
.apply-topbar__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--apply-ink);
}
.apply-topbar__logo img { height: 22px; width: auto; display: block; }
.apply-topbar__back {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-body);
  color: var(--apply-ink);
  text-decoration: none;
  border: 1px solid var(--apply-rule);
  padding: 6px 12px;
  border-radius: 2px;
}
.apply-topbar__back:hover { background: var(--apply-ink); color: var(--apply-paper); }

.apply-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 32px 96px;
  font-family: var(--sans);
}

.apply-meta {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--apply-finance-blue);
  margin-bottom: 12px;
}

.apply-title {
  font-family: var(--display);
  font-weight: var(--fw-display);
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-headline);
  margin: 0 0 12px;
  color: var(--apply-ink);
}
.apply-title em {
  /* Brand Manual v2.0: paper register em italics use --sec-finance
     (apply uses its scoped --apply-finance-blue alias). Yellow is
     reserved for the dark / agentic register only. */
  font-style: italic;
  font-weight: var(--fw-display);
  color: var(--apply-finance-blue);
}
.apply-sub {
  font-size: var(--fs-h3);
  line-height: var(--lh-base);
  margin: 0 0 40px;
  color: var(--apply-ink);
  opacity: 0.85;
}

.apply-section {
  border-top: 1px solid var(--apply-rule);
  padding: 28px 0 8px;
}
.apply-section__num {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-nav);
  color: var(--apply-finance-blue);
  margin-bottom: 8px;
}
.apply-section__head {
  font-family: var(--sans);
  font-size: var(--fs-sublede);
  margin: 0 0 16px;
  color: var(--apply-ink);
  font-weight: var(--fw-medium);
}
.apply-section__body {
  font-size: var(--fs-body);
  line-height: var(--lh-article);
  color: var(--apply-ink);
}
.apply-section__body p { margin: 0 0 14px; }
.apply-section__body p:last-child { margin-bottom: 0; }

.apply-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.apply-field label {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  text-transform: uppercase;
  color: var(--apply-ink);
  opacity: 0.7;
}
.apply-field input,
.apply-field textarea,
.apply-field select {
  font-family: var(--sans);
  font-size: var(--fs-body);
  color: var(--apply-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--apply-rule);
  padding: 8px 0;
  outline: none;
  resize: vertical;
}
.apply-field textarea { min-height: 96px; }
.apply-field input:focus,
.apply-field textarea:focus,
.apply-field select:focus {
  border-bottom-color: var(--apply-finance-blue);
}
.apply-field select.apply-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--apply-ink) 50%),
                    linear-gradient(135deg, var(--apply-ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 18px, calc(100% - 8px) 18px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 24px;
  cursor: pointer;
}
.apply-field input.apply-role-other {
  margin-top: 8px;
}

.apply-routing {
  background: var(--apply-finance-blue-soft);
  border-left: 3px solid var(--apply-finance-blue);
  padding: 16px 20px;
  margin: 12px 0 4px;
  font-size: var(--fs-body);
  line-height: var(--lh-base);
}
.apply-routing strong { color: var(--apply-finance-blue); }

.apply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--apply-rule);
}
.apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-body);
  padding: 12px 20px;
  border-radius: 2px;
  border: 1px solid var(--apply-rule);
  background: transparent;
  color: var(--apply-ink);
  text-decoration: none;
  cursor: pointer;
}
.apply-btn--primary {
  background: var(--apply-finance-blue);
  border-color: var(--apply-finance-blue);
  color: var(--apply-paper);
}
.apply-btn--primary:hover { background: var(--apply-finance-blue-dark); }
.apply-btn:hover { background: var(--apply-finance-blue-soft); }

.apply-expiry {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  color: var(--apply-ink);
  opacity: 0.6;
  margin-top: 24px;
  text-align: center;
}

/* Letterhead — sits above the first numbered section. The dateline
   is the small mono line under the headline. */
.apply-letterhead { margin-bottom: 56px; }
.apply-dateline {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  text-transform: uppercase;
  color: var(--apply-ink);
  opacity: 0.55;
  margin: -8px 0 24px;
}

/* Discipline chips inside the BACKGROUND section. */
.apply-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.apply-chip {
  display: inline-block;
  padding: 6px 12px;
  border: 0.5px solid var(--apply-finance-blue);
  border-radius: var(--r-full);
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  text-transform: uppercase;
  color: var(--apply-finance-blue);
  background: var(--apply-paper);
}

/* The single quoted conversation line. */
.apply-quote {
  margin: 0;
  padding: 16px 20px;
  border-left: 3px solid var(--apply-finance-blue);
  font-family: var(--sans);
  font-size: var(--fs-h3);
  font-style: italic;
  line-height: var(--lh-base);
  color: var(--apply-ink);
  background: var(--apply-finance-blue-soft);
}
.apply-quote--empty {
  font-style: normal;
  font-size: var(--fs-sm);
  opacity: 0.7;
}

/* Conversation summary block. */
.apply-summary {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-article);
  color: var(--apply-ink);
}
.apply-summary--empty { opacity: 0.7; font-style: italic; }

/* Routing email line under the founder name. */
.apply-routing__email {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: var(--apply-finance-blue);
}

/* Footer line below the actions. */
.apply-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 0.5px solid rgba(14, 14, 16, 0.15);
  text-align: center;
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  text-transform: uppercase;
  color: var(--apply-ink);
  opacity: 0.6;
}
.apply-footer a {
  color: var(--apply-finance-blue);
  text-decoration: underline;
}

.apply-error {
  text-align: center;
  padding: 80px 32px;
  font-family: var(--sans);
  font-size: var(--fs-h3);
  color: var(--apply-ink);
}
.apply-error a {
  color: var(--apply-finance-blue);
  text-decoration: underline;
}

/* ---- BE-APPLY simple form (task #214) ---- */
.apply-form {
  border-top: 1px solid var(--apply-rule);
  padding-top: 32px;
  margin-top: 8px;
}
.apply-field__hint {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  color: var(--apply-ink);
  opacity: 0.55;
  margin: 4px 0 0;
}
.apply-field__optional {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-body);
  text-transform: uppercase;
  color: var(--apply-ink);
  opacity: 0.45;
  margin-left: 8px;
}
/* Styled file input — paper-register treatment so the CV upload
   matches the rest of the form rather than rendering the raw browser
   control. The native input is kept (for accessibility + native file
   picker) but its ::file-selector-button is restyled into a small
   finance-blue chip, and the field gets a dashed-rule landing zone.
   Task #488 Phase 4. */
.apply-field--cv input[type="file"] {
  display: block;
  width: 100%;
  border: 1px dashed var(--apply-rule);
  border-radius: var(--r-xs);
  padding: 18px 14px;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: var(--apply-ink);
  background: var(--apply-finance-blue-soft);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.apply-field--cv input[type="file"]:hover,
.apply-field--cv input[type="file"]:focus {
  border-color: var(--apply-finance-blue);
  background: var(--apply-finance-blue-soft);
  outline: none;
}
.apply-field--cv input[type="file"]::file-selector-button {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-body);
  text-transform: uppercase;
  color: var(--apply-paper);
  background: var(--apply-finance-blue);
  border: 0;
  border-radius: var(--r-xs);
  padding: 8px 14px;
  margin-right: 14px;
  cursor: pointer;
  transition: background 160ms ease;
}
.apply-field--cv input[type="file"]::file-selector-button:hover {
  background: var(--apply-finance-blue-dark);
}
.apply-cv-pill[hidden] { display: none !important; }
.apply-cv-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--apply-finance-blue);
  border-radius: var(--r-full);
  background: var(--apply-finance-blue-soft);
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: var(--apply-finance-blue);
}
.apply-cv-pill__remove {
  background: none;
  border: 0;
  color: var(--apply-finance-blue);
  cursor: pointer;
  font-size: var(--fs-xs);
  line-height: var(--lh-tight);
  padding: 0;
}
.apply-cv-pill__remove:hover { color: var(--apply-finance-blue-dark); }
.apply-form__error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--apply-error);
  background: var(--apply-error-soft);
  color: var(--apply-error-deep);
  font-family: var(--sans);
  font-size: var(--fs-xs);
  line-height: var(--lh-base);
}
.apply-form__actions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--apply-rule);
}
.apply-form__actions .apply-btn {
  font-size: var(--fs-sm);
  padding: 14px 24px;
}
.apply-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* "Or just email us" alternative — sits below the form so it is always
   visible without competing with the primary submit button. */
.apply-alt {
  margin-top: 32px;
  padding: 20px 24px;
  border: 1px solid var(--apply-rule);
  border-radius: var(--r-xs);
  background: var(--apply-paper);
}
.apply-alt__head {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--apply-finance-blue);
  margin-bottom: 8px;
}
.apply-alt__body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--apply-ink);
}
.apply-alt__body a {
  color: var(--apply-finance-blue);
  text-decoration: underline;
}
.apply-alt__body strong { color: var(--apply-finance-blue); font-weight: var(--fw-medium); }

/* Confirmation state (in-place after a successful submit). */
.apply-confirmation {
  padding-top: 24px;
}
.apply-confirmation__meta {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-body);
  color: var(--apply-ink);
  opacity: 0.7;
  margin: 12px 0 4px;
}
.apply-confirmation__hint {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--apply-ink);
  opacity: 0.85;
  margin: 24px 0 0;
}
.apply-confirmation__hint a {
  color: var(--apply-finance-blue);
  text-decoration: underline;
}

@media (max-width: 767px) {
  .apply-topbar { padding: 14px 18px; }
  .apply-wrap { padding: 32px 18px 80px; }
  .apply-title { font-size: var(--fs-display); }
  .apply-sub { font-size: var(--fs-body); }
  .apply-actions { flex-direction: column; }
  .apply-btn { width: 100%; justify-content: center; }
  .apply-letterhead { margin-bottom: 40px; }
  .apply-quote { font-size: var(--fs-body); }
}

/* Print stylesheet — used by the "Download PDF" action which calls
   window.print() so the browser's "Save as PDF" path emits a clean
   register without the topbar / actions / footer chrome. */
@media print {
  body { background: var(--white) !important; }
  .apply-topbar,
  .apply-actions,
  .apply-section--actions,
  .apply-footer { display: none !important; }
  .apply-wrap { padding: 0; max-width: none; }
  .apply-section input,
  .apply-section textarea {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
}
