/* apply.css — the page 申请: why to learn, the four steps, the application form, 问答.
 * Author: [ASTRO-S2] helper of the 命理学 iMac window — a17 supervisor (Claude Opus 5.5), 2026-11-15. New file.
 * Co-written: [ASTRO-R2] helper of the 命理学 iMac window — a5 supervisor, session of 2026-11-15 (Claude Opus 5.5),
 * 2026-11-15 — the reveal no longer switched off for reduced motion (N203); the controls' own short transitions rule kept.
 *
 * Loaded after home-sections.css, whose root rules give the isolation from Bricks and the shared look (the section
 * carries both classes: .astro-home.astro-apply). Every rule here is at (0,2,0) or more, so it beats the rollback
 * `.astro-home *:not(…) { all: revert }` (0,1,1). No rem, no web font, no picture from another host.
 * Static first: everything is visible without JavaScript; .is-enhanced / .is-pending are set only by
 * assets/js/motion/apply.js, and only on blocks still below the screen. Nothing is folded (N169).
 * Form controls: labels always above their field; 48 px fields (16 px text on a phone — no zoom on focus);
 * focus, filled and error states without JavaScript (:focus-visible, :placeholder-shown, :user-invalid).
 */

/* anchors land below the fixed site header */
.astro-apply .ah-sec,
.astro-apply .ap-faq__group,
.astro-apply .ap-qa { scroll-margin-top: calc(var(--astro-header-h, 0px) + 24px); }

.astro-apply .ap-h1 { font-size: clamp(30px, 3vw, 42px); }

/* ---------- the four steps ---------- */
.astro-apply .ap-steps__list {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px;
  margin: 0 0 clamp(48px, 7vh, 80px); padding: 0; list-style: none;
}
.astro-apply .ap-step { display: block; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--ah-line-2); }
.astro-apply .ap-step__num { display: block; margin: 0 0 14px; font-size: 14px; }
.astro-apply .ap-step__name {
  display: block; margin: 0 0 .6em;
  font-family: var(--ah-song); font-weight: 600; font-size: 22px; line-height: 1.5; letter-spacing: .1em; color: var(--ah-text);
}
.astro-apply .ap-step__link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--ah-line-2); }
.astro-apply .ap-step__link:hover { color: var(--ah-lamp); border-bottom-color: var(--ah-lamp); }
.astro-apply.astro-apply .ap-step__link:focus-visible { outline: 2px solid var(--ah-cinnabar); outline-offset: 3px; }
.astro-apply .ap-step__text { display: block; margin: 0; font-size: 16px; line-height: 1.85; color: var(--ah-body); }
.astro-apply .ap-notes { grid-column: 6 / 13; }

/* ---------- the application form ---------- */
.astro-apply .ap-form-wrap {
  grid-column: 3 / 11; display: block; padding: clamp(28px, 4vw, 56px);
  border: 1px solid var(--ah-line-2); background: #100E0B;
}
.astro-apply .ap-form { display: block; margin: 0; }
.astro-apply .ap-form__set {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px 24px; /* one column: no placeholder is cut */
  margin: 0; padding: 0; border: 0; min-width: 0;
}
.astro-apply .ap-form__legend {
  grid-column: 1 / -1; float: left; width: 100%; display: block; margin: 0 0 8px; padding: 0 0 18px;
  border-bottom: 1px solid var(--ah-line-2);
  font-family: var(--ah-song); font-weight: 600; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.4; letter-spacing: .1em;
  color: var(--ah-text);
}
.astro-apply .ap-form__hidden { display: none; }
.astro-apply .ap-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.astro-apply .ap-field--wide { grid-column: 1 / -1; }
.astro-apply .ap-label {
  display: block; margin: 0; font-size: 15px; line-height: 1.6; letter-spacing: .06em; color: var(--ah-text);
}
.astro-apply .ap-req { display: inline; margin-left: .3em; color: var(--ah-lamp); }
.astro-apply .ap-input {
  display: block; width: 100%; min-height: 48px; margin: 0; padding: 11px 14px;
  border: 1px solid rgba(226, 168, 71, .38); border-radius: 2px; background: #0A0907; color: #ECE3D0;
  font-family: var(--ah-sans); font-size: 17px; line-height: 1.6; letter-spacing: .02em;
  box-shadow: none; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .2s var(--ah-ease), background-color .2s var(--ah-ease);
}
.astro-apply .ap-input--area { min-height: 112px; resize: vertical; field-sizing: content; max-height: 420px; }
/* Bricks: `textarea { line-height: inherit !important }` — found by the comparison under its three stylesheets
 * (site-pages/s2/evidence/bricks-2); answered with !important at a higher specificity (0,3,0). */
.astro-apply.astro-apply .ap-input--area { line-height: 1.6 !important; }
/* With the layered Bricks file (bricks-frontend-layer) a layered !important beats any unlayered one, so the textarea
 * takes `inherit` there: its field wrapper carries the same 1.6, and the inherited value is the same. */
.astro-apply .ap-field--wide { line-height: 1.6; }
.astro-apply .ap-input::placeholder { color: #A39A85; opacity: 1; /* 7.1:1 on the field */ }
.astro-apply .ap-input:hover { border-color: rgba(226, 168, 71, .6); }
.astro-apply.astro-apply .ap-input:focus,
.astro-apply.astro-apply .ap-input:focus-visible {
  border-color: var(--ah-lamp); background: #14110C; outline: 2px solid rgba(226, 168, 71, .35); outline-offset: 2px;
}
.astro-apply .ap-input:not(:placeholder-shown) { border-color: rgba(226, 168, 71, .7); }
.astro-apply .ap-input:user-invalid { border-color: #D9654F; }
.astro-apply .ap-field.is-invalid .ap-input { border-color: #D9654F; }
.astro-apply .ap-field.is-invalid .ap-label { color: #F0A28F; }
.astro-apply .ap-form__note {
  grid-column: 1 / -1; display: block; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--ah-line);
  font-size: 16px; line-height: 1.85; color: var(--ah-body);
}
.astro-apply .ap-form__go { grid-column: 1 / -1; display: block; margin: 0; }
.astro-apply .ap-submit {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 200px; margin: 0;
  padding: 12px 36px; border: 1px solid var(--ah-lamp); border-radius: 2px; background: var(--ah-lamp); color: #0A0907;
  font-family: var(--ah-sans); font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: .12em;
  cursor: pointer; transition: background-color .2s var(--ah-ease), color .2s var(--ah-ease);
}
.astro-apply .ap-submit:hover { background: #F0BC62; }
.astro-apply.astro-apply .ap-submit:focus-visible { outline: 2px solid var(--ah-cinnabar); outline-offset: 3px; }

/* ---------- 问答: every question with its answer, open ---------- */
.astro-apply .ap-faq__index { display: block; }
.astro-apply .ap-faq__index-list { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.astro-apply .ap-faq__index-link {
  font-family: var(--ah-song); font-size: 18px; line-height: 1.8; letter-spacing: .12em; color: var(--ah-lamp);
  text-decoration: none; border-bottom: 1px solid var(--ah-line-2);
}
.astro-apply .ap-faq__index-link:hover { border-bottom-color: var(--ah-lamp); }
.astro-apply.astro-apply .ap-faq__index-link:focus-visible { outline: 2px solid var(--ah-cinnabar); outline-offset: 3px; }
.astro-apply .ap-faq__group { display: block; margin-top: clamp(64px, 10vh, 120px); }
.astro-apply .ap-faq__group > .ah-grid::before {
  content: ""; display: block; grid-column: 1 / -1; height: 7px; margin-bottom: clamp(32px, 5vh, 56px);
  border-top: 1px solid var(--ah-line-2);
  background: repeating-linear-gradient(90deg, var(--ah-line) 0 1px, transparent 1px 12px) top left / 100% 6px no-repeat;
}
.astro-apply .ap-faq__group-head { grid-column: 1 / 5; display: block; }
.astro-apply .ap-faq__group-name {
  display: block; position: sticky; top: calc(var(--astro-header-h, 0px) + 32px); margin: 0;
  font-family: var(--ah-song); font-weight: 600; font-size: clamp(28px, 2.8vw, 40px); line-height: 1.3; letter-spacing: .12em;
  color: var(--ah-text);
}
.astro-apply .ap-faq__list { grid-column: 5 / 13; display: block; margin: 0; padding: 0; list-style: none; max-width: 38em; }
.astro-apply .ap-qa {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 8px;
  margin: 0 0 clamp(40px, 6vh, 64px); padding: 0;
}
.astro-apply .ap-qa > * { grid-column: 2; }
.astro-apply .ap-qa__num { grid-column: 1; grid-row: 1; display: block; padding-top: 6px; font-size: 14px; }
.astro-apply .ap-qa__q {
  display: block; margin: 0 0 .7em;
  font-family: var(--ah-song); font-weight: 600; font-size: 21px; line-height: 1.6; letter-spacing: .04em; color: var(--ah-text);
}
.astro-apply .ap-qa__similar {
  display: block; margin: 0 0 .5em; padding-left: 14px; border-left: 1px solid var(--ah-line-2);
  font-size: 16px; line-height: 1.8; color: var(--ah-dim);
}
.astro-apply .ap-qa__similar + .ap-qa__a { margin-top: .9em; }
.astro-apply .ap-qa__a { font-size: 17px; line-height: 1.9; }

.astro-apply .ap-qr { display: block; max-width: 1180px; margin: clamp(72px, 12vh, 140px) auto 0; padding: 0 var(--ah-x) clamp(72px, 10vh, 120px); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .astro-apply .ap-steps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .astro-apply .ap-form-wrap { grid-column: 2 / 12; }
}
@media (max-width: 820px) {
  .astro-apply .ap-form-wrap { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .astro-apply .ap-notes, .astro-apply .ap-faq__group-head, .astro-apply .ap-faq__list { grid-column: 1 / -1; }
  .astro-apply .ap-faq__group-name { position: static; margin-bottom: 28px; }
}
@media (max-width: 600px) {
  .astro-apply .ap-steps__list { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .astro-apply .ap-form-wrap { padding: 24px 18px; }
  .astro-apply .ap-form__set { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .astro-apply .ap-input { font-size: 16px; }
  .astro-apply .ap-submit { width: 100%; }
  .astro-apply .ap-qa { grid-template-columns: 36px minmax(0, 1fr); }
  .astro-apply .ap-qa__q { font-size: 19px; }
  .astro-apply .ap-qa__a { font-size: 16px; line-height: 1.85; }
  .astro-apply .ap-step__text { font-size: 15px; }
}

/* ---------- movement (only with apply.js) ---------- */
.astro-apply.is-enhanced .ap-reveal { transition: opacity .42s var(--ah-ease), transform .42s var(--ah-ease); }
.astro-apply.is-enhanced .ap-reveal.is-pending { opacity: 0; transform: translateY(10px); }
/* [ASTRO-R2] 2026-11-15 (N203: the animations play for everyone): the reveal is no longer switched off for reduced
 * motion. Kept: only the form controls' own short hover / focus colour transitions are dropped when reduced motion is
 * asked for — a state change of a control, not an animation of the page. */
@media (prefers-reduced-motion: reduce) {
  .astro-apply .ap-input, .astro-apply .ap-submit { transition: none; }
}
@media print {
  .astro-apply.is-enhanced .ap-reveal.is-pending { opacity: 1; transform: none; }
}
@media (forced-colors: active) {
  .astro-apply .ap-faq__group > .ah-grid::before { background: none; }
  .astro-apply .ap-input { border: 1px solid CanvasText; }
  .astro-apply .ap-submit { border: 1px solid ButtonText; }
}
