/* =========================================================
   JBU — Apply for Auditions (mobile-first)
   ========================================================= */

.apply-page {
    --a-bg: #060607;
    --a-card: rgba(18, 18, 20, 0.86);
    --a-field: #0d0d0f;
    --a-border: rgba(255, 255, 255, 0.08);
    --a-border-strong: rgba(255, 255, 255, 0.14);
    --a-text: #f5f5f6;
    --a-text-2: #a8a8b0;
    --a-text-3: #74747c;
    --a-red: #e0413e;
    --a-red-deep: #b5282a;
    --a-red-soft: rgba(224, 65, 62, 0.12);
    --a-red-line: rgba(224, 65, 62, 0.45);
    --a-green: #25d366;
    background: var(--a-bg);
    overflow-x: hidden;
}

.apply-page .navbar { background: linear-gradient(to bottom, rgba(6, 6, 7, 0.92), rgba(6, 6, 7, 0)); }

/* Ambient background */
.apply-glow {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(60vmax 40vmax at 50% -12%, rgba(181, 40, 42, 0.28), transparent 60%),
        radial-gradient(40vmax 30vmax at 110% 40%, rgba(181, 40, 42, 0.08), transparent 60%),
        radial-gradient(40vmax 30vmax at -10% 80%, rgba(181, 40, 42, 0.06), transparent 60%);
}
.apply-main { position: relative; z-index: 1; }

/* ---------- Hero ---------- */
.apply-hero {
    max-width: 720px;
    margin: 0 auto;
    padding: 132px 20px 28px;
    text-align: center;
}
.casting-chip {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--a-border-strong);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--a-text-2);
    font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em;
    margin-bottom: 22px;
}
.casting-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a-text-3); position: relative; flex-shrink: 0; }
.casting-chip.is-live { color: #d9fbe6; border-color: rgba(37, 211, 102, 0.35); background: rgba(37, 211, 102, 0.08); }
.casting-chip.is-live .casting-dot { background: var(--a-green); }
.casting-chip.is-live .casting-dot::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--a-green); opacity: 0;
    animation: castPulse 1.8s ease-out infinite;
}
@keyframes castPulse { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.6); opacity: 0; } }

.apply-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 9vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--a-text);
    margin: 0 0 18px;
}
.apply-title .accent {
    background: linear-gradient(100deg, #ff6b62 0%, #e0413e 45%, #b5282a 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.apply-lede {
    color: var(--a-text-2);
    font-size: clamp(1rem, 3.6vw, 1.15rem);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 26px;
}

.perk-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.perk {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--a-border);
    color: #d6d6db; font-size: 0.82rem; font-weight: 500;
}
.perk i { color: #ff7a72; font-size: 0.8rem; }

/* ---------- Form card ---------- */
.apply-shell { max-width: 640px; margin: 0 auto; padding: 8px 16px 72px; }
.apply-card {
    background: var(--a-card);
    border: 1px solid var(--a-border);
    border-radius: 24px;
    padding: 28px 24px 26px;
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.form-step { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--a-border); }
.form-step:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 8px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step-num {
    width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--a-red-soft); border: 1px solid var(--a-red-line);
    color: #ff8a83; font-weight: 700; font-size: 0.85rem;
}
.step-title { font-family: 'Inter', sans-serif; font-size: 1.05rem; font-weight: 600; color: var(--a-text); letter-spacing: -0.01em; line-height: 1.3; margin: 0; }
.step-sub { color: var(--a-text-3); font-size: 0.82rem; line-height: 1.4; margin: 2px 0 0; }

/* Fields */
.apply-card .form-label {
    display: block;
    margin: 0 0 8px;
    color: #d4d4da;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0;
}
.apply-card .form-input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    margin: 0 0 18px;
    background: var(--a-field);
    border: 1px solid var(--a-border-strong);
    border-radius: 14px;
    color: var(--a-text);
    font-family: 'Inter', sans-serif;
    font-size: 16px; /* 16px prevents iOS zoom-on-focus */
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none; appearance: none;
}
.apply-card .form-input::placeholder { color: #5f5f67; }
.apply-card .form-input:hover { border-color: rgba(255, 255, 255, 0.2); }
.apply-card .form-input:focus {
    outline: none;
    border-color: var(--a-red-line);
    background: #111114;
    box-shadow: 0 0 0 4px var(--a-red-soft);
}
.apply-card select.form-input {
    cursor: pointer; padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a8a8b0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
}
.apply-card select.form-input:invalid { color: #6c6c74; }
.apply-card select.form-input option { background: #151517; color: #fff; }
.apply-card #applyingFor { height: 58px; font-weight: 600; border-color: var(--a-red-line); background-color: rgba(224, 65, 62, 0.06); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* Chips (languages + custom multichoice) */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--a-border-strong);
    background: var(--a-field);
    color: #cfcfd5; font-size: 0.92rem; font-weight: 500;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.chip:active { transform: scale(0.97); }
.chip input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip .chip-tick {
    width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0;
    border: 1.5px solid #4a4a52; display: grid; place-items: center;
    font-size: 10px; color: transparent;
    transition: all 0.15s;
}
.chip.is-on, .chip:has(input:checked) { border-color: var(--a-red-line); background: var(--a-red-soft); color: #fff; }
.chip.is-on .chip-tick, .chip:has(input:checked) .chip-tick { background: var(--a-red); border-color: var(--a-red); color: #fff; }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--a-red-soft); }
#other-lang-input { margin-top: -6px; }

/* Role cards (Interested in?) */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 6px; }
.role-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    padding: 18px 16px; border-radius: 16px;
    border: 1px solid var(--a-border-strong); background: var(--a-field);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.role-card:active { transform: scale(0.98); }
.role-card input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.role-icon {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.05); color: #d6d6db; font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}
.role-name { color: var(--a-text); font-weight: 600; font-size: 0.98rem; }
.role-desc { color: var(--a-text-3); font-size: 0.8rem; line-height: 1.45; }
.role-check {
    position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid #4a4a52; display: grid; place-items: center; color: transparent; font-size: 11px;
    transition: all 0.15s;
}
.role-card.is-on, .role-card:has(input:checked) { border-color: var(--a-red-line); background: linear-gradient(180deg, rgba(224, 65, 62, 0.14), rgba(224, 65, 62, 0.04)); }
.role-card.is-on .role-icon, .role-card:has(input:checked) .role-icon { background: var(--a-red); color: #fff; }
.role-card.is-on .role-check, .role-card:has(input:checked) .role-check { background: var(--a-red); border-color: var(--a-red); color: #fff; }
.role-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--a-red-soft); }

/* Dynamic (admin-defined) fields */
#dynamic-fields-container:not(:empty) { padding-top: 6px; }

/* WhatsApp + submit */
.wa-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; margin: 4px 0 20px;
    border-radius: 16px;
    background: rgba(37, 211, 102, 0.07);
    border: 1px solid rgba(37, 211, 102, 0.25);
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.wa-card:hover { background: rgba(37, 211, 102, 0.11); }
.wa-card:active { transform: scale(0.99); }
.wa-icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--a-green); color: #fff; font-size: 1.35rem; }
.wa-text { flex: 1; min-width: 0; }
.wa-title { color: var(--a-text); font-weight: 600; font-size: 0.95rem; }
.wa-sub { color: #9fe7bd; font-size: 0.82rem; margin-top: 2px; }
.wa-arrow { color: var(--a-green); font-size: 0.9rem; }

.apply-submit {
    width: 100%;
    height: 58px;
    border: none; border-radius: 16px;
    background: linear-gradient(180deg, #ea4b47, #b5282a);
    color: #fff;
    font-family: 'Inter', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 16px 34px -12px rgba(224, 65, 62, 0.7);
    transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.apply-submit:hover { filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 20px 40px -12px rgba(224, 65, 62, 0.85); }
.apply-submit:active { transform: translateY(1px) scale(0.995); }
.apply-submit:disabled { opacity: 0.7; cursor: wait; }
.submit-note { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; color: var(--a-text-3); font-size: 0.82rem; text-align: center; }
.submit-note i { color: #8a8a92; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .apply-hero { padding: 112px 18px 22px; }
    .casting-chip { margin-bottom: 18px; }
    .apply-lede { margin-bottom: 20px; }
    .perk-row { gap: 6px; }
    .perk { font-size: 0.78rem; padding: 7px 12px; }
    .apply-shell { padding: 4px 12px 56px; }
    .apply-card { padding: 22px 16px 20px; border-radius: 20px; }
    .field-row { grid-template-columns: 1fr; }
    .role-card { padding: 16px 14px; }
    .role-desc { font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
    .casting-chip.is-live .casting-dot::after { animation: none; }
}
