/* ===== auth: login modal (assets/js/auth/auth-flow.js) ===== */
:root { --al-grad: linear-gradient(135deg, #129ae8, #7c3aed); }
.al-modal .modal-dialog { max-width: 420px; }
.al-content {
    position: relative;
    overflow: hidden;
    color: var(--text-dark);
    background: var(--surface-1);
    border: 0;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
}
.al-modal.is-busy .al-content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--surface-1) 60%, transparent);
    cursor: progress;
}

.al-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .2);
    cursor: pointer;
    transition: background .18s, transform .18s;
}
.al-close:hover { background: rgba(255, 255, 255, .35); transform: rotate(90deg); }
.al-close .material-symbols-outlined { font-size: 20px; }
.al-close[hidden], .al-help[hidden], .al-sub[hidden] { display: none; }

/* ---- hero ---- */
.al-hero {
    position: relative;
    overflow: hidden;
    padding: 26px 24px 22px;
    text-align: center;
    color: #fff;
    background: var(--al-grad);
}
.al-hero::before, .al-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.al-hero::before { width: 160px; height: 160px; top: -70px; right: -40px; }
.al-hero::after { width: 100px; height: 100px; bottom: -45px; left: -25px; }
.al-hero > * { position: relative; }
.al-hero-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, .2);
    backdrop-filter: blur(4px);
}
.al-hero-icon .material-symbols-outlined { font-size: 32px; font-variation-settings: 'FILL' 1; }
.al-title { margin: 0; font-size: 1.25rem; font-weight: 800; }
.al-sub { margin: 4px 0 0; font-size: .92rem; opacity: .92; }

/* ---- steps ---- */
.al-steps { position: relative; padding: 20px 22px 6px; }
.al-step { display: none; }
.al-step.is-active { display: block; animation: al-in .32s cubic-bezier(.22, 1, .36, 1); }
.al-step.is-active.is-back { animation-name: al-in-back; }
@keyframes al-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes al-in-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

.al-label { display: block; margin: 12px 0 6px; font-size: .85rem; font-weight: 700; color: var(--text-light); }
.al-optional { font-weight: 500; opacity: .8; }

.al-phone {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-1);
    transition: border-color .18s, box-shadow .18s;
}
.al-phone:focus-within, .al-input:focus {
    border-color: #129ae8;
    box-shadow: 0 0 0 4px rgba(18, 154, 232, .15);
    outline: 0;
}
.al-phone-code {
    display: grid;
    place-items: center;
    padding: 0 12px;
    font-weight: 700;
    color: var(--text-light);
    background: var(--hover-bg);
    border-right: 1px solid var(--border-color);
}
.al-input {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    font-size: 1.1rem;
    letter-spacing: .5px;
    color: var(--text-dark);
    background: transparent;
    border: 0;
}
.al-phone .al-input:focus { box-shadow: none; }
.al-input-full { border: 1.5px solid var(--border-color); border-radius: 14px; font-size: 1rem; letter-spacing: 0; }
.al-input::placeholder { color: var(--text-light); opacity: .55; }

.al-error {
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    font-size: .85rem;
    font-weight: 600;
    color: #dc2626;
    opacity: 0;
    transition: max-height .2s, opacity .2s, margin .2s;
}
.al-error.show { max-height: 70px; margin: 8px 0 0; opacity: 1; }
.al-error.is-ok { color: #16a34a; }

/* ---- buttons ---- */
.al-btn {
    position: relative;
    width: 100%;
    margin-top: 16px;
    padding: 13px 18px;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: var(--al-grad);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(18, 154, 232, .32);
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, opacity .18s;
}
.al-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(18, 154, 232, .38); }
.al-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.al-btn.is-loading { cursor: progress; opacity: 1; }
.al-btn.is-loading .al-btn-text { visibility: hidden; }
.al-spin { display: none; }
.al-btn.is-loading .al-spin {
    display: block;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: al-rot .7s linear infinite;
}
@keyframes al-rot { to { transform: rotate(360deg); } }

.al-link {
    padding: 0;
    font-weight: 700;
    color: #129ae8;
    background: none;
    border: 0;
    cursor: pointer;
}
.al-link:hover:not(:disabled) { text-decoration: underline; }
.al-link:disabled { color: var(--text-light); opacity: .6; cursor: default; }

.al-note, .al-resend, .al-sent { margin: 12px 0 0; font-size: .85rem; text-align: center; color: var(--text-light); }
.al-sent { margin: 0 0 14px; font-size: .92rem; line-height: 1.8; }
.al-sent b { color: var(--text-dark); letter-spacing: .5px; }

/* ---- google ---- */
.al-google { display: flex; justify-content: center; min-height: 44px; }
.al-google[hidden], .al-or[hidden] { display: none; }
.al-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; font-size: .8rem; color: var(--text-light); }
.al-or::before, .al-or::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }

/* ---- otp ---- */
.al-otp { display: flex; justify-content: center; gap: 8px; }
.al-otp-digit {
    width: 100%;
    max-width: 50px;
    height: 56px;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-dark);
    background: var(--surface-1);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}
.al-otp-digit:focus { border-color: #129ae8; box-shadow: 0 0 0 4px rgba(18, 154, 232, .15); outline: 0; transform: translateY(-2px); }
.al-otp-digit.filled { border-color: #7c3aed; background: color-mix(in srgb, #7c3aed 8%, var(--surface-1)); }
.al-otp-digit:disabled { opacity: .7; }
.al-otp + .al-error { text-align: center; }
.al-shake { animation: al-shake .4s; }
@keyframes al-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ---- profile ---- */
.al-ok { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 4px; font-weight: 700; color: #16a34a; }
.al-ok .material-symbols-outlined { font-size: 22px; font-variation-settings: 'FILL' 1; }

/* ---- welcome ---- */
.al-done { text-align: center; padding: 6px 0 18px; }
.al-done.is-active { animation-name: al-pop; }
@keyframes al-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.al-check { width: 84px; height: 84px; margin: 0 auto 10px; }
.al-check svg { width: 100%; height: 100%; }
.al-check circle { stroke: #16a34a; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: al-draw .6s .1s ease-out forwards; }
.al-check path { stroke: #16a34a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: al-draw .4s .55s ease-out forwards; }
@keyframes al-draw { to { stroke-dashoffset: 0; } }
.al-done-text { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text-dark); }
.al-modal.is-done .al-steps { padding-bottom: 10px; }

.al-help { margin: 0; padding: 10px 22px 18px; font-size: .8rem; text-align: center; color: var(--text-light); }
.al-help a { font-weight: 700; color: #129ae8; text-decoration: none; }

/* ---- phones: a bottom sheet ---- */
@media (max-width: 575.98px) {
    .al-modal .modal-dialog { margin: 0; max-width: none; min-height: 100%; align-items: flex-end; }
    .al-modal.fade .modal-dialog { transform: translateY(60px); }
    .al-modal.show .modal-dialog { transform: none; }
    .al-content { width: 100%; border-radius: 26px 26px 0 0; }
    .al-hero { padding-top: 22px; padding-bottom: 18px; }
    .al-otp { gap: 6px; }
    .al-otp-digit { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .al-step.is-active, .al-shake { animation-duration: .01s; }
    .al-check circle, .al-check path { animation-duration: .01s; animation-delay: 0s; }
    .al-close:hover, .al-btn:hover:not(:disabled), .al-otp-digit:focus { transform: none; }
}

/* ---- "login required" page (auth/required.php) ---- */
.al-gate-main { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); }
.al-gate {
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    text-align: center;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 26px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
    animation: al-pop .4s cubic-bezier(.22, 1, .36, 1);
}
.al-gate-hero {
    position: relative;
    display: grid;
    place-items: center;
    padding: 26px 20px 38px;
    background: linear-gradient(135deg, #129ae8, #7c3aed);
    overflow: hidden;
}
.al-gate-hero::before, .al-gate-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.al-gate-hero::before { width: 170px; height: 170px; top: -70px; right: -40px; }
.al-gate-hero::after { width: 110px; height: 110px; bottom: -50px; left: -30px; }
.al-gate-ring { position: absolute; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.al-gate-img { position: relative; width: 140px; max-width: 60%; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .25)); animation: wow-bob 4s ease-in-out infinite; }
.al-gate-badge {
    position: absolute;
    left: 50%;
    bottom: -22px;
    z-index: 2;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #7c3aed;
    background: var(--surface-1);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
}
.al-gate-badge .material-symbols-outlined { font-size: 26px; font-variation-settings: 'FILL' 1; }
.al-gate-body { padding: 34px 22px 22px; }
.al-gate-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; color: var(--text-dark); }
.al-gate-text { margin: 0; color: var(--text-light); line-height: 1.7; }
.al-gate-points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; text-align: left; }
.al-gate-points li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-dark);
    background: color-mix(in srgb, #129ae8 7%, var(--surface-1));
    border-radius: 12px;
}
.al-gate-points .material-symbols-outlined { flex: 0 0 auto; font-size: 20px; color: #129ae8; }
.al-gate-btn { margin-top: 18px; }
.al-gate-home { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-weight: 600; color: var(--text-light); text-decoration: none; }
.al-gate-home .material-symbols-outlined { font-size: 18px; }
.al-gate-home:hover { color: var(--text-dark); }
@media (prefers-reduced-motion: reduce) { .al-gate, .al-gate-img { animation: none; } }
