/* =====================================================================
   Admission Enquiry — Heritage Design Templates (Directions A / B / C)
   Theme colours + heading font are injected as --aep-* variables inline.
   Selectors are scoped under #aep-modal.aep-tpl-* so they override the
   default frontend.css modal styling without !important.
   ===================================================================== */

#aep-modal.aep-tpl {
    --aep-warm-white: #fffdf8;
    --aep-ink: #2b2420;
    --aep-ink-soft: #5d534a;
    --aep-muted-2: #9a8f81;
    --aep-line: #e7ddcd;
    --aep-line-strong: #d9ccb6;
    --aep-modal-radius: 16px;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(58, 14, 22, .45), transparent 60%),
        rgba(20, 10, 14, .62);
}

#aep-modal.aep-tpl .aep-tpl-container {
    background: transparent;
    max-width: 100%;
    border-radius: var(--aep-modal-radius);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);
    border: 1px solid rgba(231, 212, 168, .25);
    overflow: hidden;
    font-family: var(--aep-field-font);
    color: var(--aep-ink);
    max-height: 92vh;
}

#aep-modal.aep-tpl .aep-tpl-scroll { overflow-y: auto; min-height: 0; }

/* ---- Shared field grid ---- */
#aep-modal.aep-tpl .aep-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
}
#aep-modal.aep-tpl .aep-form-field { margin-bottom: 0; }
/* Wide controls span the full row */
#aep-modal.aep-tpl .aep-field-textarea,
#aep-modal.aep-tpl .aep-field-radio,
#aep-modal.aep-tpl .aep-field-checkbox { grid-column: 1 / -1; }

#aep-modal.aep-tpl .aep-required { color: var(--aep-req); margin-left: 2px; font-weight: 700; }

/* ---- Shared submit button (.submit in the handoff) ---- */
#aep-modal.aep-tpl .aep-submit-button {
    font-family: var(--aep-field-font);
    font-weight: 800; letter-spacing: .03em; font-size: 15px;
    color: var(--aep-gold-200);
    background: linear-gradient(180deg, var(--aep-maroon-700), var(--aep-maroon-800));
    border: none; border-radius: 11px;
    padding: 15px 22px; width: 100%;
    cursor: pointer;
    box-shadow: 0 10px 24px -10px rgba(58, 14, 22, .6);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
#aep-modal.aep-tpl .aep-submit-button:hover:not(:disabled) {
    filter: brightness(1.06); transform: translateY(-1px);
    box-shadow: 0 14px 30px -10px rgba(58, 14, 22, .7);
}
#aep-modal.aep-tpl .aep-submit-button:disabled { opacity: .75; cursor: default; }
#aep-modal.aep-tpl .aep-arrow { font-size: 16px; opacity: .85; }

/* ---- Shared close button (.closex) ---- */
#aep-modal.aep-tpl .aep-closex {
    appearance: none; border: none; cursor: pointer;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, transform .15s ease;
}
#aep-modal.aep-tpl .aep-closex:hover { transform: rotate(90deg); }

/* ---- Standard inputs for Directions A & B ---- */
#aep-modal.aep-tpl-heritage .aep-form-field label,
#aep-modal.aep-tpl-editorial .aep-form-field label {
    display: block; margin-bottom: 7px;
    font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
    color: var(--aep-ink); text-transform: none;
}
#aep-modal.aep-tpl-heritage .aep-form-field input,
#aep-modal.aep-tpl-heritage .aep-form-field select,
#aep-modal.aep-tpl-heritage .aep-form-field textarea,
#aep-modal.aep-tpl-editorial .aep-form-field input,
#aep-modal.aep-tpl-editorial .aep-form-field select,
#aep-modal.aep-tpl-editorial .aep-form-field textarea {
    font-family: var(--aep-field-font);
    font-size: 14.5px; color: var(--aep-ink);
    background: var(--aep-warm-white);
    border: 1px solid var(--aep-line-strong);
    border-radius: 9px;
    padding: 12px 14px; width: 100%;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    outline: none;
}
#aep-modal.aep-tpl-heritage .aep-form-field input::placeholder,
#aep-modal.aep-tpl-editorial .aep-form-field input::placeholder,
#aep-modal.aep-tpl-heritage .aep-form-field textarea::placeholder,
#aep-modal.aep-tpl-editorial .aep-form-field textarea::placeholder { color: #b3a896; }
#aep-modal.aep-tpl-heritage .aep-form-field input:focus,
#aep-modal.aep-tpl-heritage .aep-form-field select:focus,
#aep-modal.aep-tpl-heritage .aep-form-field textarea:focus,
#aep-modal.aep-tpl-editorial .aep-form-field input:focus,
#aep-modal.aep-tpl-editorial .aep-form-field select:focus,
#aep-modal.aep-tpl-editorial .aep-form-field textarea:focus {
    border-color: var(--aep-gold-500);
    box-shadow: 0 0 0 3px rgba(189, 147, 80, .18);
    background: #fff;
}

/* =====================================================================
   DIRECTION A — Heritage Crest
   ===================================================================== */
#aep-modal.aep-tpl-heritage .aep-tpl-container { width: 640px; background: var(--aep-cream); display: flex; flex-direction: column; }
#aep-modal.aep-tpl-heritage .aep-a-head {
    position: relative;
    background:
        radial-gradient(140% 120% at 50% -40%, var(--aep-maroon-600), transparent 55%),
        linear-gradient(180deg, var(--aep-maroon-700), var(--aep-maroon-800));
    padding: 26px 30px 24px; text-align: center; color: #fff;
    border-bottom: 3px solid var(--aep-gold-500);
}
#aep-modal.aep-tpl-heritage .aep-a-head .aep-closex {
    position: absolute; top: 16px; right: 16px;
    color: var(--aep-gold-200); background: rgba(255, 255, 255, .1);
}
#aep-modal.aep-tpl-heritage .aep-a-head .aep-closex:hover { background: rgba(255, 255, 255, .2); }
#aep-modal.aep-tpl-heritage .aep-a-crestwrap {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--aep-warm-white); padding: 5px; margin: 0 auto 12px;
    box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .45), 0 0 0 2px var(--aep-gold-500);
}
#aep-modal.aep-tpl-heritage .aep-a-crestwrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
#aep-modal.aep-tpl-heritage .aep-a-school {
    font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
    color: var(--aep-gold-200); margin: 0 0 5px;
}
#aep-modal.aep-tpl-heritage .aep-a-title {
    font-family: var(--aep-display-font); font-weight: 700;
    font-size: 30px; line-height: 1.05; margin: 0; color: #fff;
}
#aep-modal.aep-tpl-heritage .aep-a-sub { font-size: 12.5px; color: rgba(255, 255, 255, .7); margin: 7px 0 0; font-weight: 500; }
#aep-modal.aep-tpl-heritage .aep-a-body { padding: 26px 30px 28px; flex: 1 1 auto; }
#aep-modal.aep-tpl-heritage .aep-a-foot { margin-top: 22px; }
#aep-modal.aep-tpl-heritage .aep-a-note { text-align: center; font-size: 11.5px; color: var(--aep-muted-2); margin: 13px 0 0; }

/* =====================================================================
   DIRECTION B — Editorial Split
   ===================================================================== */
#aep-modal.aep-tpl-editorial .aep-tpl-container {
    width: 900px; background: var(--aep-warm-white);
    display: grid; grid-template-columns: 330px 1fr;
}
#aep-modal.aep-tpl-editorial .aep-b-aside {
    position: relative; color: #fff; padding: 38px 34px;
    display: flex; flex-direction: column; overflow: hidden;
    background:
        radial-gradient(120% 80% at 20% 0%, var(--aep-maroon-600), transparent 55%),
        linear-gradient(165deg, var(--aep-maroon-700) 0%, var(--aep-maroon-900) 100%);
}
#aep-modal.aep-tpl-editorial .aep-b-aside::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(231, 212, 168, .10) 1px, transparent 1.4px);
    background-size: 16px 16px; opacity: .5; pointer-events: none;
}
#aep-modal.aep-tpl-editorial .aep-b-aside > * { position: relative; z-index: 1; }
#aep-modal.aep-tpl-editorial .aep-b-crestwrap {
    width: 74px; height: 74px; border-radius: 50%;
    background: var(--aep-warm-white); padding: 5px;
    box-shadow: 0 0 0 2px var(--aep-gold-500), 0 8px 20px -6px rgba(0, 0, 0, .5);
}
#aep-modal.aep-tpl-editorial .aep-b-crestwrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
#aep-modal.aep-tpl-editorial .aep-b-school {
    font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
    color: var(--aep-gold-200); margin: 24px 0 0;
}
#aep-modal.aep-tpl-editorial .aep-b-head {
    font-family: var(--aep-display-font); font-weight: 600;
    font-size: 34px; line-height: 1.08; margin: 10px 0 0;
}
#aep-modal.aep-tpl-editorial .aep-b-rule { width: 46px; height: 2px; background: var(--aep-gold-500); margin: 18px 0; }
#aep-modal.aep-tpl-editorial .aep-b-lead {
    font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, .78);
    max-width: 30ch; margin: 0;
}
#aep-modal.aep-tpl-editorial .aep-b-contact { margin-top: auto; padding-top: 26px; }
#aep-modal.aep-tpl-editorial .aep-b-contact div {
    font-size: 12.5px; color: rgba(255, 255, 255, .72);
    display: flex; align-items: center; gap: 9px; margin-top: 8px;
}
#aep-modal.aep-tpl-editorial .aep-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--aep-gold-400); flex: none; }
#aep-modal.aep-tpl-editorial .aep-b-form { position: relative; padding: 32px 34px 30px; max-height: 92vh; }
#aep-modal.aep-tpl-editorial .aep-b-aside { max-height: 92vh; }
#aep-modal.aep-tpl-editorial .aep-b-form .aep-closex {
    position: absolute; top: 18px; right: 18px;
    color: var(--aep-maroon-700); background: var(--aep-paper);
}
#aep-modal.aep-tpl-editorial .aep-b-form .aep-closex:hover { background: var(--aep-line); }
#aep-modal.aep-tpl-editorial .aep-b-eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: var(--aep-gold-600); margin: 2px 0 4px;
}
#aep-modal.aep-tpl-editorial .aep-b-formtitle {
    font-family: var(--aep-display-font); font-weight: 600; font-size: 23px;
    margin: 0 0 22px; color: var(--aep-ink);
}
#aep-modal.aep-tpl-editorial .aep-form-grid { gap: 15px 16px; }
#aep-modal.aep-tpl-editorial .aep-b-foot { margin-top: 22px; }

/* =====================================================================
   DIRECTION C — Minimal Classic
   ===================================================================== */
#aep-modal.aep-tpl-minimal .aep-tpl-container {
    width: 680px; background: #fff; position: relative;
    border: none; border-top: 4px solid var(--aep-maroon-700);
    display: flex; flex-direction: column;
}
#aep-modal.aep-tpl-minimal .aep-closex {
    position: absolute; top: 22px; right: 22px;
    color: var(--aep-ink-soft); background: #f4efe6;
}
#aep-modal.aep-tpl-minimal .aep-closex:hover { background: var(--aep-line); }
#aep-modal.aep-tpl-minimal .aep-c-head { padding: 30px 40px 4px; display: flex; align-items: center; gap: 15px; }
#aep-modal.aep-tpl-minimal .aep-c-crestwrap {
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; padding: 3px; flex: none;
    box-shadow: 0 0 0 1.5px var(--aep-gold-500);
}
#aep-modal.aep-tpl-minimal .aep-c-crestwrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
#aep-modal.aep-tpl-minimal .aep-c-school {
    font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
    color: var(--aep-gold-600); margin: 0 0 2px;
}
#aep-modal.aep-tpl-minimal .aep-c-title {
    font-family: var(--aep-display-font); font-weight: 600; font-size: 26px;
    margin: 0; color: var(--aep-ink); line-height: 1;
}
#aep-modal.aep-tpl-minimal .aep-c-divider { height: 1px; background: var(--aep-line); margin: 22px 40px 0; }
#aep-modal.aep-tpl-minimal .aep-c-body { padding: 24px 40px 32px; flex: 1 1 auto; }
#aep-modal.aep-tpl-minimal .aep-form-grid { gap: 18px 22px; }
#aep-modal.aep-tpl-minimal .aep-form-field label {
    display: block; margin-bottom: 7px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--aep-ink-soft);
}
#aep-modal.aep-tpl-minimal .aep-form-field input,
#aep-modal.aep-tpl-minimal .aep-form-field select,
#aep-modal.aep-tpl-minimal .aep-form-field textarea {
    font-family: var(--aep-field-font); font-size: 14.5px; color: var(--aep-ink);
    border: none; border-bottom: 1.5px solid var(--aep-line-strong);
    border-radius: 0; background: transparent; padding: 9px 2px; width: 100%;
    transition: border-color .18s ease; outline: none;
}
#aep-modal.aep-tpl-minimal .aep-form-field input::placeholder,
#aep-modal.aep-tpl-minimal .aep-form-field textarea::placeholder { color: #b3a896; }
#aep-modal.aep-tpl-minimal .aep-form-field input:focus,
#aep-modal.aep-tpl-minimal .aep-form-field select:focus,
#aep-modal.aep-tpl-minimal .aep-form-field textarea:focus {
    border-bottom-color: var(--aep-maroon-700); box-shadow: none; background: transparent;
}
#aep-modal.aep-tpl-minimal .aep-c-foot {
    margin-top: 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
#aep-modal.aep-tpl-minimal .aep-c-foot .aep-submit-button { width: auto; padding: 14px 30px; border-radius: 9px; }
#aep-modal.aep-tpl-minimal .aep-c-required-note { font-size: 11.5px; color: var(--aep-muted-2); margin: 0; }

/* =====================================================================
   Responsive — collapse to a single column; stack the editorial panel
   ===================================================================== */
@media (max-width: 720px) {
    #aep-modal.aep-tpl-editorial .aep-tpl-container { grid-template-columns: 1fr; width: 560px; }
    #aep-modal.aep-tpl-editorial .aep-b-aside { padding: 28px 28px; }
    #aep-modal.aep-tpl-editorial .aep-b-contact { padding-top: 18px; }
}
@media (max-width: 600px) {
    #aep-modal.aep-tpl .aep-form-grid { grid-template-columns: 1fr; }
    #aep-modal.aep-tpl-heritage .aep-tpl-container,
    #aep-modal.aep-tpl-minimal .aep-tpl-container,
    #aep-modal.aep-tpl-editorial .aep-tpl-container { width: 100%; }
    #aep-modal.aep-tpl-heritage .aep-a-body { padding: 22px 22px 24px; }
    #aep-modal.aep-tpl-minimal .aep-c-head,
    #aep-modal.aep-tpl-minimal .aep-c-body { padding-left: 24px; padding-right: 24px; }
    #aep-modal.aep-tpl-minimal .aep-c-divider { margin-left: 24px; margin-right: 24px; }
    #aep-modal.aep-tpl-minimal .aep-c-foot { flex-direction: column-reverse; align-items: stretch; }
    #aep-modal.aep-tpl-minimal .aep-c-foot .aep-submit-button { width: 100%; }
    #aep-modal.aep-tpl-heritage .aep-a-title { font-size: 26px; }
    #aep-modal.aep-tpl-editorial .aep-b-head { font-size: 28px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    #aep-modal.aep-tpl .aep-submit-button,
    #aep-modal.aep-tpl .aep-closex,
    #aep-modal.aep-tpl .aep-form-field input,
    #aep-modal.aep-tpl .aep-form-field select,
    #aep-modal.aep-tpl .aep-form-field textarea { transition: none; }
    #aep-modal.aep-tpl .aep-submit-button:hover:not(:disabled) { transform: none; }
    #aep-modal.aep-tpl .aep-closex:hover { transform: none; }
}
