/* E3 — Pre-admission application (apply.php). Uses the site's design tokens. */

[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--font-body); }

/* ---------- Hero ---------- */
.ap-hero { padding-top: clamp(2.5rem, 5vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5.5rem); }
.ap-hero__grid { display: grid; gap: var(--space-2xl); align-items: end; }
@media (min-width: 1024px) { .ap-hero__grid { grid-template-columns: 1.4fr 1fr; gap: var(--space-3xl); } }
.ap-back { display: inline-block; font-size: var(--text-xs); color: var(--text-secondary); margin-bottom: var(--space-lg); }
.ap-back:hover { color: var(--navy); }
.ap-hero h1 { margin-top: var(--space-lg); font-size: var(--text-display); line-height: var(--lh-display); }
.ap-hero__ar { margin-top: var(--space-sm); font-size: clamp(1.125rem, 1.5vw + .5rem, 1.5rem); color: var(--navy-light); text-align: left; }
.ap-hero .text-lead { margin-top: var(--space-lg); }
.ap-hero__ar-lead { margin-top: var(--space-sm); color: var(--text-secondary); font-size: var(--text-small); line-height: 1.8; text-align: right; }
.ap-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: rgba(39, 45, 60, .1); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.ap-facts li { background: var(--white); padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .35rem; position: relative; }
.ap-facts li::before { content: ""; position: absolute; left: 0; top: 1.25rem; bottom: 1.25rem; width: 3px; background: var(--gold); }
.ap-facts span { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-secondary); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ap-facts i { font-style: normal; font-family: "IBM Plex Sans Arabic", var(--font-body); letter-spacing: 0; text-transform: none; font-size: .75rem; color: var(--navy-light); }
.ap-facts strong { font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; color: var(--navy); line-height: 1.3; }

/* ---------- Layout ---------- */
.ap-section { padding-block: clamp(3rem, 7vw, 6rem); }
.ap-layout { display: grid; gap: var(--space-2xl); align-items: start; }
@media (min-width: 1024px) { .ap-layout { grid-template-columns: 300px 1fr; gap: var(--space-3xl); } }
.ap-side { display: flex; flex-direction: column; gap: var(--space-xl); }
@media (min-width: 1024px) { .ap-side { position: sticky; top: 7rem; } }
.ap-side__intro { font-size: var(--text-small); color: var(--text-secondary); line-height: 1.65; display: flex; flex-direction: column; gap: var(--space-sm); }
.ap-side__intro [lang="ar"] { line-height: 1.9; }
.ap-side__links a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.ap-side__links span { color: var(--text-tertiary); margin: 0 .35rem; }

/* Step list */
.ap-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; counter-reset: none; }
.ap-steps__item { display: flex; gap: .875rem; align-items: center; padding: .6rem .75rem; border-radius: var(--radius); color: var(--text-secondary); transition: background var(--duration-fast) var(--ease-out); }
.ap-js .ap-steps__item.is-reachable { cursor: pointer; }
.ap-js .ap-steps__item.is-reachable:hover { background: var(--ivory); }
.ap-steps__n { width: 1.875rem; height: 1.875rem; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(39, 45, 60, .18); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: .75rem; color: var(--navy); background: var(--white); transition: all var(--duration) var(--ease); }
.ap-steps__t { display: flex; flex-direction: column; font-size: var(--text-small); font-weight: 500; line-height: 1.3; }
.ap-steps__t small { font-weight: 400; font-size: .75rem; color: var(--text-tertiary); text-align: left; }
.ap-steps__item.is-done .ap-steps__n { background: var(--gold-muted); border-color: var(--gold); }
.ap-steps__item.is-current { background: var(--ivory); color: var(--navy); }
.ap-steps__item.is-current .ap-steps__n { background: var(--navy); border-color: var(--navy); color: var(--gold); }
@media (max-width: 1023px) {
  .ap-steps { flex-direction: row; gap: .375rem; }
  .ap-steps__item { flex: 1; padding: 0; justify-content: center; background: none !important; }
  .ap-steps__t { display: none; }
}

/* ---------- Card ---------- */
.ap-card { background: var(--white); border: 1px solid rgba(39, 45, 60, .08); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.5rem, 4vw, 3rem); position: relative; overflow: hidden; min-width: 0; }
.ap-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--cool-gray); }
.ap-progress__bar { display: block; height: 100%; width: 16.66%; background: var(--gold); transition: width var(--duration-slow) var(--ease); }
.ap-required-note { font-size: var(--text-xs); color: #B3261E; margin-bottom: var(--space-lg); }
.ap-required-note .ap-ar { color: #B3261E; }

/* Steps: all shown without JavaScript, one at a time with it */
.ap-step + .ap-step { margin-top: var(--space-3xl); padding-top: var(--space-2xl); border-top: 1px solid var(--cool-gray); }
.ap-js .ap-step { display: none; margin-top: 0; padding-top: 0; border-top: 0; }
.ap-js .ap-step.is-active { display: block; animation: ap-in var(--duration) var(--ease); }
@keyframes ap-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ap-js .ap-step.is-active { animation: none; } }

.ap-step__head { margin-bottom: var(--space-xl); }
.ap-step__count { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-secondary); }
.ap-step__head h2 { font-size: var(--text-h2); line-height: var(--lh-heading); margin-top: var(--space-xs); outline: none; }
.ap-step__ar { font-size: 1.125rem; color: var(--navy-light); margin-top: .25rem; text-align: left; }
.ap-note { background: var(--ivory); border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.25rem; margin-bottom: var(--space-xl); display: flex; flex-direction: column; gap: .35rem; font-size: var(--text-small); color: var(--navy); line-height: 1.6; }
.ap-note [lang="ar"] { color: var(--text-secondary); }

/* ---------- Questions ---------- */
.ap-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-xl) var(--space-xl); }
@media (min-width: 720px) { .ap-grid { grid-template-columns: 1fr 1fr; } .ap-q { grid-column: 1 / -1; } .ap-q--half { grid-column: auto; } }
.ap-q { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.ap-q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ap-label { font-size: var(--text-small); font-weight: 500; color: var(--navy); line-height: 1.5; padding: 0; }
.ap-ar { font-family: "IBM Plex Sans Arabic", var(--font-body); font-weight: 400; color: var(--text-secondary); unicode-bidi: isolate; }
.ap-sep { color: var(--gold); margin: 0 .2em; }
.ap-req { color: #B3261E; }
.ap-help { font-size: var(--text-xs); color: var(--text-secondary); margin: .1rem 0 .2rem; }
.ap-q .form-input:not(textarea):not(select) { background-image: none; padding-right: 0; }
.ap-q textarea.form-input { background-image: none; padding-right: 0; min-height: 7rem; line-height: 1.6; }
.ap-q select.form-input { cursor: pointer; }
.ap-q input[type="date"].form-input { min-height: 2.9rem; }

.ap-choices { display: grid; gap: .5rem; margin-top: .6rem; }
.ap-choice { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; border: 1px solid rgba(39, 45, 60, .12); border-radius: var(--radius); cursor: pointer; font-size: var(--text-small); color: var(--navy); line-height: 1.45; transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out); position: relative; }
.ap-choice:hover { border-color: rgba(231, 193, 120, .8); background: var(--off-white); }
.ap-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap-choice__mark { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: .1rem; border: 1.5px solid var(--navy-light); background: var(--white); display: flex; align-items: center; justify-content: center; transition: all var(--duration-fast) var(--ease-out); }
.ap-choice input[type="radio"] + .ap-choice__mark { border-radius: 50%; }
.ap-choice input[type="checkbox"] + .ap-choice__mark { border-radius: 3px; }
.ap-choice input:checked + .ap-choice__mark { border-color: var(--navy); background: var(--navy); box-shadow: inset 0 0 0 3px var(--white); }
.ap-choice input[type="checkbox"]:checked + .ap-choice__mark { box-shadow: none; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E7C178' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 75% no-repeat; }
.ap-choice:has(input:checked) { border-color: var(--gold); background: rgba(231, 193, 120, .08); }
.ap-choice input:focus-visible + .ap-choice__mark { outline: 2px solid var(--gold); outline-offset: 2px; }
.ap-other { margin: -.15rem 0 0 2.9rem; width: calc(100% - 2.9rem) !important; }
.ap-other:disabled { opacity: .45; }
@media (min-width: 720px) {
  .ap-q[data-field="contact_methods"] .ap-choices, .ap-q[data-field="call_languages"] .ap-choices,
  .ap-q[data-field="best_time"] .ap-choices, .ap-q[data-field="degree_in_english"] .ap-choices { grid-template-columns: 1fr 1fr; }
}

.ap-consent { font-size: var(--text-small); }
.ap-consent .ap-sep { display: none; }
.ap-consent .ap-ar { display: block; margin-top: .25rem; }

.ap-error { font-size: var(--text-xs); color: #B3261E; margin: .2rem 0 0; }
.ap-q.has-error .ap-label, .ap-q.has-error legend { color: #B3261E; }
.ap-q.has-error .form-input { border-bottom-color: #B3261E; }
.ap-q.has-error .ap-choice { border-color: rgba(179, 38, 30, .35); }

/* ---------- Navigation ---------- */
.ap-status { margin: var(--space-xl) 0 0; }
.ap-nav { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px solid var(--cool-gray); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-lg); }
.ap-nav__buttons { display: flex; gap: .75rem; flex-wrap: wrap; }
.ap-nav__meta { display: flex; align-items: center; gap: 1.25rem; font-size: var(--text-xs); color: var(--text-secondary); }
.ap-nav [data-ap-back], .ap-nav [data-ap-next], .ap-nav__page, .ap-draft, .ap-clear { display: none; }
.ap-js .ap-nav [data-ap-next], .ap-js .ap-nav__page, .ap-js .ap-clear { display: inline-flex; }
.ap-js .ap-nav [data-ap-back] { display: inline-flex; }
.ap-js .ap-nav [data-ap-back][hidden], .ap-js .ap-nav [data-ap-next][hidden], .ap-js .ap-nav [data-ap-submit][hidden] { display: none; }
.ap-js .ap-draft:not([hidden]) { display: inline-flex; align-items: center; gap: .35rem; }
.ap-draft::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: #3C8A55; }
.ap-clear { background: none; border: 0; padding: 0; font: inherit; color: #9A6B10; font-weight: 500; cursor: pointer; }
.ap-clear:hover { text-decoration: underline; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Done ---------- */
.ap-done { text-align: center; padding: var(--space-xl) 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.ap-done[hidden] { display: none; }
.ap-done__icon { width: 4rem; height: 4rem; border-radius: 50%; background: var(--gold-muted); color: var(--navy); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-sm); }
.ap-done h2 { font-size: var(--text-h3); max-width: 28rem; }
.ap-done p { color: var(--text-secondary); max-width: 32rem; font-size: var(--text-small); }
.ap-done__ref { background: var(--ivory); padding: .6rem 1.1rem; border-radius: var(--radius); color: var(--navy) !important; }
.ap-done__ref strong { font-family: var(--font-mono); letter-spacing: .04em; }
.ap-done .btn { margin-top: var(--space-lg); }
