/* ==========================================================================
   KarachiHalls — Sign-in screen (glassmorphism)
   ========================================================================== */

.auth-login-page {
    --auth-navy: #111827;
    --auth-ink: #0f172a;
    --auth-muted: #6b7280;
    --auth-muted-2: #9ca3af;
    --auth-field: #f3f4f6;
    --auth-field-border: transparent;
    --auth-white: #ffffff;
    --auth-radius-card: 32px;
    --auth-radius-control: 14px;
    --auth-shadow: 0 24px 80px rgba(15, 50, 90, 0.14);
    margin: 0;
    min-height: 100vh;
    background: #8ec4ea;
    color: var(--auth-ink);
    font-family: Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-login {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #8ec4ea url('../images/login-bg.webp') center / cover no-repeat;
}

.auth-login__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.auth-login__rings {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.auth-login__rings span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(160vmax, 2400px);
    height: min(160vmax, 2400px);
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 0 28px rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(0.08);
    opacity: 0;
    animation: auth-ring-pulse 6.5s cubic-bezier(0.12, 0.4, 0.2, 1) infinite;
    will-change: transform, opacity;
}

.auth-login__rings span:nth-child(1) { animation-delay: -0.1s; }
.auth-login__rings span:nth-child(2) { animation-delay: -1.2s; }
.auth-login__rings span:nth-child(3) { animation-delay: -2.3s; }
.auth-login__rings span:nth-child(4) { animation-delay: -3.4s; }
.auth-login__rings span:nth-child(5) { animation-delay: -4.5s; }
.auth-login__rings span:nth-child(6) { animation-delay: -5.6s; }

@keyframes auth-ring-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.08);
        opacity: 0.15;
    }
    12% {
        opacity: 0.95;
    }
    70% {
        opacity: 0.35;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-login__rings span {
        animation: none;
        opacity: 0.55;
    }

    .auth-login__rings span:nth-child(1) { transform: translate(-50%, -50%) scale(0.18); }
    .auth-login__rings span:nth-child(2) { transform: translate(-50%, -50%) scale(0.34); }
    .auth-login__rings span:nth-child(3) { transform: translate(-50%, -50%) scale(0.5); }
    .auth-login__rings span:nth-child(4) { transform: translate(-50%, -50%) scale(0.66); }
    .auth-login__rings span:nth-child(5) { transform: translate(-50%, -50%) scale(0.82); }
    .auth-login__rings span:nth-child(6) { transform: translate(-50%, -50%) scale(0.98); }
}

.auth-login__brand {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 28px 32px;
    text-decoration: none;
    color: var(--auth-ink);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.auth-login__brand:hover {
    color: var(--auth-ink);
}

.auth-login__logo {
    display: block;
    width: 440px;
    max-width: calc(100vw - 56px);
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(15, 23, 42, 0.35));
}

.auth-login__stage {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px 48px;
}

.auth-login__card {
    width: 100%;
    max-width: 420px;
    padding: 36px 36px 32px;
    border-radius: var(--auth-radius-card);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.78) 0%, rgba(236, 245, 255, 0.52) 100%);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        var(--auth-shadow);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.auth-login__icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    display: grid;
    place-items: center;
    color: #111;
}

.auth-login__icon svg {
    width: 20px;
    height: 20px;
}

.auth-login__title {
    margin: 0 0 10px;
    text-align: center;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: #111;
    line-height: 1.2;
}

.auth-login__subtitle {
    margin: 0 auto 28px;
    max-width: 300px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--auth-muted);
    font-weight: 500;
}

.auth-login__alert {
    border: 0;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.85rem;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.auth-login__alert--success {
    background: #ecfdf5;
    color: #065f46;
}

.auth-login__field {
    position: relative;
    margin-bottom: 12px;
}

.auth-login__field .auth-login__lead-icon {
    position: absolute;
    left: 16px;
    top: 26px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.auth-login__input {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 46px;
    border: 1px solid transparent;
    border-radius: var(--auth-radius-control);
    background: var(--auth-field);
    color: var(--auth-ink);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.auth-login__input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.auth-login__input:hover {
    background: #eef0f3;
}

.auth-login__input:focus {
    background: #fff;
    border-color: #d1d5db;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.06);
}

.auth-login__input.is-invalid {
    border-color: #DC2626;
    background: #fff;
}

.auth-login__input.is-invalid:focus {
    border-color: #DC2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.auth-login__field .invalid-feedback {
    display: none;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: #DC2626;
    min-height: 1.15em;
}

.auth-login__field .invalid-feedback.d-block,
.auth-login__input.is-invalid ~ .invalid-feedback,
.auth-login__field .is-invalid ~ .invalid-feedback {
    display: block;
}

.auth-login__submit.is-submitting {
    opacity: 0.72;
    cursor: wait;
    pointer-events: none;
}

.auth-login__toggle {
    position: absolute;
    right: 8px;
    top: 26px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #9ca3af;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.auth-login__toggle:hover {
    color: #4b5563;
    background: rgba(0, 0, 0, 0.04);
}

.auth-login__toggle svg {
    width: 18px;
    height: 18px;
}

.auth-login__forgot-row {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 18px;
}

.auth-login__forgot {
    border: 0;
    background: none;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    text-decoration: none;
}

.auth-login__forgot:hover {
    color: #111;
    text-decoration: underline;
}

.auth-login__submit {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: var(--auth-radius-control);
    background: linear-gradient(180deg, #2a3140 0%, #111827 55%, #0b1220 100%);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 10px 22px rgba(17, 24, 39, 0.28);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-login__submit:hover {
    filter: brightness(1.08);
}

.auth-login__submit:active {
    transform: translateY(1px);
}

.auth-login__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--auth-muted-2);
    font-size: 0.8rem;
    font-weight: 500;
}

.auth-login__divider::before,
.auth-login__divider::after {
    content: '';
    flex: 1;
    border-top: 1.5px dashed #d1d5db;
}

.auth-login__socials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.auth-login__social {
    height: 52px;
    border-radius: 14px;
    border: 1px solid #eceff3;
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-login__social:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.auth-login__social svg {
    width: 22px;
    height: 22px;
}

.auth-login__hint {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: #4b5563;
    font-size: 0.8rem;
    line-height: 1.45;
    text-align: center;
}

.auth-login__hint.is-visible {
    display: block;
}

.auth-login__footer {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 20px 28px;
    font-size: 0.82rem;
    color: #334155;
}

.auth-login__footer a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}

.auth-login__footer a:hover {
    text-decoration: underline;
}

.auth-login__demos {
    margin-top: 10px;
    color: #475569;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .auth-login {
        padding-top: env(safe-area-inset-top);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
    }

    .auth-login__rings {
        display: none;
    }

    .auth-login__brand {
        padding: 20px 18px;
    }

    .auth-login__stage {
        align-items: stretch;
        padding: 8px 0 16px;
    }

    .auth-login__card {
        width: auto;
        max-width: none;
        margin: 16px;
        padding: 28px 22px 24px;
        border-radius: 24px;
    }

    .auth-login__title {
        font-size: 1.4rem;
    }

    .auth-login__input,
    .auth-login button,
    .auth-login .btn {
        font-size: 16px;
        min-height: 48px;
    }
}

@media (max-width: 375px), (max-height: 700px) {
    .auth-login__brand {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .auth-login__stage {
        padding-bottom: 16px;
    }

    .auth-login__card {
        padding: 22px 18px 20px;
    }

    .auth-login__icon {
        margin-bottom: 12px;
    }

    .auth-login__subtitle {
        margin-bottom: 20px;
    }

    .auth-login__footer {
        padding-bottom: 18px;
    }
}

/* ==========================================================================
   Phone & tablet sign-in — app style (desktop unchanged)
   ========================================================================== */
@media (max-width: 991.98px) {
    .auth-login__stage { align-items: center; padding: 8px 24px 32px; }
    .auth-login__card { max-width: 440px; height: auto; }
}

@media (max-width: 767.98px) {
    .auth-login-page { background: #0a1628; }
    .auth-login { min-height: 100vh; min-height: 100dvh; padding: 0; }
    /* Darken the photo towards the bottom so the sheet reads cleanly */
    .auth-login::after {
        content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
        background: linear-gradient(180deg, rgba(10,22,40,.15) 0%, rgba(10,22,40,.35) 45%, rgba(10,22,40,.85) 100%);
    }
    .auth-login__rings { display: none; }

    /* Logo sits on the photo, centred in the space above the sheet */
    .auth-login__brand {
        flex: 1 1 auto; display: flex; justify-content: center; align-items: center;
        min-height: 30vh; padding: calc(env(safe-area-inset-top) + 24px) 24px 20px;
    }
    .auth-login__logo { width: 250px; max-width: 72vw; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }

    /* Solid bottom sheet instead of a stretched glass box */
    .auth-login__stage { flex: 0 0 auto; display: block; padding: 0; }
    .auth-login__card {
        position: relative; width: 100%; max-width: none; height: auto; margin: 0;
        padding: 30px 22px 18px;
        border: 0; border-radius: 28px 28px 0 0;
        background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none;
        box-shadow: 0 -20px 50px -12px rgba(0,0,0,.45);
    }
    .auth-login__card::before {
        content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px;
        border-radius: 999px; background: #e2e8f0;
    }
    .auth-login__icon {
        width: 46px; height: 46px; margin: 4px 0 14px; border-radius: 14px;
        background: #0a1628; color: #c9a227; box-shadow: 0 8px 18px -8px rgba(10,22,40,.6);
    }
    .auth-login__title { text-align: left; font-size: 1.45rem; margin-bottom: 6px; }
    .auth-login__subtitle { text-align: left; max-width: none; margin: 0 0 20px; font-size: .88rem; }
    .auth-login__field { margin-bottom: 12px; }
    .auth-login__input { min-height: 52px; border-radius: 14px; font-size: 16px; }
    .auth-login__submit { min-height: 52px; border-radius: 14px; font-size: 1rem; }
    .auth-login__forgot-row { margin: 2px 0 16px; }

    /* Footer continues the sheet so there is no gap at the bottom */
    .auth-login__footer {
        background: #fff; color: #64748b; margin: 0;
        padding: 0 22px calc(18px + env(safe-area-inset-bottom));
    }
    .auth-login__demos { margin-top: 0; padding-top: 12px; border-top: 1px solid #f1f5f9; color: #94a3b8; }
}

@media (max-width: 767.98px) and (max-height: 640px) {
    .auth-login__brand { min-height: 0; padding-top: calc(env(safe-area-inset-top) + 16px); padding-bottom: 14px; }
    .auth-login__logo { width: 200px; }
    .auth-login__icon { display: none; }
    .auth-login__card { padding-top: 24px; }
}
