/**
 * AIBM Enrollment Badge pages — enquiry form (modal) styles.
 * Brand: AIBM navy #075584, magenta #972571.
 *
 * @author Sameer Ali
 */

.enq-overlay {
    --navy: #075584;
    --navy-dark: #043a5b;
    --magenta: #972571;
    --ice: #f2fafc;
    --line: #d9e6ee;
    --text: #1d2b36;
    --muted: #5d7080;
    --danger: #c62828;

    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(4, 30, 48, .62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    animation: enqFade .2s ease;
}
.enq-overlay[hidden] { display: none; }

.enq-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    text-align: left;
    animation: enqRise .28s cubic-bezier(.2, .9, .3, 1.1);
}

.enq-close {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 2;
    width: 36px; height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 24px;
    line-height: 36px;
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.enq-close:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }

/* ---------- Header ---------- */
.enq-head {
    position: relative;
    padding: 30px 32px 26px;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(420px 160px at 100% 0%, rgba(151, 37, 113, .55), transparent 70%),
        linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 55%, #0a6fa8 100%);
}
.enq-head::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--magenta), #c2459a 50%, var(--magenta));
}
.enq-head-cap {
    width: 54px; height: 54px;
    object-fit: contain;
    padding: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    margin-bottom: 10px;
}
.enq-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .85;
}
.enq-head h2 {
    font-family: "El Messiri", Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    margin: 6px 0 8px;
    color: #fff;
}
.enq-head p {
    margin: 0 auto;
    max-width: 400px;
    font-size: 14.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .88);
}
.enq-course-chip {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
}

/* ---------- Form ---------- */
.enq-form { padding: 26px 32px 28px; }
.enq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.enq-group { margin-bottom: 16px; }
.enq-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--navy-dark);
}

.enq-input { position: relative; }
.enq-input svg,
.enq-privacy svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.enq-input svg {
    position: absolute;
    left: 14px; top: 50%;
    width: 18px; height: 18px;
    transform: translateY(-50%);
    color: #8aa0b0;
    pointer-events: none;
    transition: color .2s;
}

.enq-form input[type=text],
.enq-form input[type=email],
.enq-form input[type=tel],
.enq-form select {
    display: block;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 14px 0 44px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: #f8fbfd;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.enq-form input::placeholder { color: #9aabb8; }
.enq-form input:focus,
.enq-form select:focus {
    background: #fff;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(7, 85, 132, .12);
}
.enq-input:focus-within svg { color: var(--navy); }

.enq-select select { cursor: pointer; padding-right: 40px; }
.enq-select select:invalid,
.enq-select select option[value=""] { color: #9aabb8; }
.enq-select::after {
    content: "";
    position: absolute;
    right: 18px; top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

/* Phone with dial code */
.enq-phone {
    position: relative;
    display: flex;
    height: 50px;
    background: #f8fbfd;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.enq-phone:focus-within {
    background: #fff;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(7, 85, 132, .12);
}
.enq-dial-btn {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 16px;
    border: 0;
    border-right: 1.5px solid var(--line);
    border-radius: 12px 0 0 12px;
    background: transparent;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-dark);
    cursor: pointer;
}
.enq-dial-btn:hover { background: var(--ice); }
.enq-caret {
    width: 7px; height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s;
}
.enq-dial-btn[aria-expanded="true"] .enq-caret { transform: translateY(2px) rotate(-135deg); }
.enq-form .enq-phone input[type=tel] {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding-left: 14px;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: transparent;
    box-shadow: none;
}
.enq-dial-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 5;
    width: min(320px, 100%);
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(7, 85, 132, .2);
}
.enq-dial-menu[hidden] { display: none; }
.enq-form .enq-dial-search {
    display: block;
    width: 100%;
    height: 40px;
    margin: 0 0 6px;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    outline: none;
}
.enq-form .enq-dial-search:focus { border-color: var(--navy); }
.enq-dial-menu ul {
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}
.enq-dial-menu li {
    display: flex;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.enq-dial-menu li:hover,
.enq-dial-menu li.is-active { background: var(--ice); }
.enq-dial-menu li[aria-selected="true"] { background: var(--navy); color: #fff; }
.enq-dial-menu li[aria-selected="true"] .enq-dial-code { color: #fff; }
.enq-dial-code { min-width: 48px; font-weight: 600; color: var(--navy); }

/* ---------- Errors (same behaviour as the EdStone landing pages) ---------- */
.field-error {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}
.field-error:not(:empty) { display: flex; align-items: center; gap: 6px; }
.field-error:not(:empty)::before {
    content: "!";
    flex: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
.enq-group.has-error .enq-form input,
.enq-group.has-error input[type=text],
.enq-group.has-error input[type=email],
.enq-group.has-error select,
.enq-group.has-error .enq-phone {
    border-color: var(--danger);
    background: #fff8f8;
}
.enq-group.has-error .enq-phone input[type=tel] { background: transparent; }
.enq-group.has-error .enq-input svg { color: var(--danger); }
.enq-group.has-error { animation: enqShake .35s; }

.enq-general-error {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--danger);
    background: #fdeeed;
    border: 1px solid #f5c6c2;
    border-left: 4px solid var(--danger);
    border-radius: 10px;
}
.enq-general-error[hidden] { display: none; }

/* ---------- Submit ---------- */
.enq-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--magenta) 0%, #b7378d 100%);
    box-shadow: 0 10px 24px rgba(151, 37, 113, .35);
    transition: transform .15s, box-shadow .2s, opacity .2s;
}
.enq-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(151, 37, 113, .42); }
.enq-arrow { transition: transform .2s; }
.enq-submit:hover .enq-arrow { transform: translateX(4px); }
.enq-spinner {
    display: none;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: enqSpin .7s linear infinite;
}
.enq-submit.is-loading { opacity: .85; cursor: progress; transform: none; }
.enq-submit.is-loading .enq-arrow { display: none; }
.enq-submit.is-loading .enq-spinner { display: inline-block; }

.enq-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}
.enq-privacy svg { width: 14px; height: 14px; flex: none; }

/* ---------- Floating "Enquire now" button ---------- */
.enq-fab {
    position: fixed;
    right: 22px; bottom: 22px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border: 0;
    border-radius: 999px;
    font: 600 15px "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--fab-a, #972571), var(--fab-b, #b7378d));
    box-shadow: 0 12px 28px rgba(151, 37, 113, .4);
    animation: enqRise .4s ease .6s both;
    transition: transform .15s;
}
.enq-fab:hover { transform: translateY(-2px); }

/* ---------- Animations ---------- */
@keyframes enqFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes enqRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes enqSpin { to { transform: rotate(360deg); } }
@keyframes enqShake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
    .enq-overlay, .enq-modal, .enq-fab, .enq-group.has-error { animation: none; }
}

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 560px) {
    .enq-overlay { align-items: flex-end; padding: 0; }
    .enq-modal { max-width: none; border-radius: 20px 20px 0 0; }
    .enq-head { padding: 26px 22px 22px; }
    .enq-head h2 { font-size: 22px; }
    .enq-form { padding: 22px 20px 26px; }
    .enq-fab { right: 14px; bottom: 14px; padding: 12px 18px; }
}
