:root {
    --alcros-navy: #071428;
    --alcros-navy-mid: #0c2247;
    --alcros-gold: #f4b400;
    --alcros-gold-hover: #e5a800;
}

html,
body.auth-portal {
    height: 100%;
    overflow: hidden;
}

.auth-portal {
    font-family: 'Inter', sans-serif;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: #1e293b;
    position: relative;
    overflow: hidden;
}

/* Fixed building background — does not scroll with content */
.auth-portal::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(105deg, rgba(7, 20, 40, 0.94) 0%, rgba(7, 20, 40, 0.82) 42%, rgba(7, 20, 40, 0.55) 68%, rgba(7, 20, 40, 0.45) 100%),
        url('../../../images/municipal-hall.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.auth-portal-header {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    background: var(--alcros-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-portal-header-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 640px) {
    .auth-portal-header-inner {
        padding: 0.75rem 1.5rem;
    }
}

.auth-portal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    text-decoration: none;
}

.auth-portal-brand-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.auth-portal-card-logo {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 9999px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 12px 32px rgba(7, 20, 40, 0.18);
    flex-shrink: 0;
}

.auth-portal-brand-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.125rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth-portal-brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6875rem;
    font-style: italic;
    line-height: 1.35;
    margin-top: 0.125rem;
}

.auth-portal-header-link {
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    padding: 0.45rem 1rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.auth-portal-header-link:hover {
    background: #fff;
    color: var(--alcros-navy);
}

.auth-portal-main {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.auth-portal-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(7, 20, 40, 0.35);
    flex-shrink: 0;
}

.auth-portal-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(244, 180, 0, 0.35);
    background: rgba(244, 180, 0, 0.12);
    color: #92400e;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-portal-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--alcros-gold);
    color: var(--alcros-navy);
    border: none;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 8px 20px rgba(244, 180, 0, 0.25);
    cursor: pointer;
}

.auth-portal-btn:hover {
    background: var(--alcros-gold-hover);
}

.auth-portal-btn:active {
    transform: scale(0.98);
}

.auth-portal-card-footer {
    background: rgba(248, 250, 252, 0.95);
    border-top: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.auth-portal-card .back-home--center {
    color: var(--alcros-navy-mid);
}

.auth-portal-card .back-home--center:hover {
    color: var(--alcros-navy);
    background-color: rgba(7, 20, 40, 0.06);
    box-shadow: none;
}

.auth-portal-card a.text-blue-600,
.auth-portal-card .text-blue-600 {
    color: #0c4a8a !important;
}

.auth-portal-card a.text-blue-600:hover {
    color: var(--alcros-navy) !important;
}

.login-card {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.auth-portal-lockout {
    padding: 0.25rem 0 0.5rem;
}

.auth-portal-lockout__icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(244, 180, 0, 0.18), rgba(244, 180, 0, 0.06));
    color: #92400e;
    border: 1px solid rgba(244, 180, 0, 0.35);
    box-shadow: 0 8px 24px rgba(244, 180, 0, 0.12);
}

.auth-portal-lockout__title {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--alcros-navy);
    text-align: center;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.auth-portal-lockout__lead {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.55;
    color: #64748b;
    text-align: center;
    margin: 0 0 1.25rem;
}

.auth-portal-lockout__timer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(7, 20, 40, 0.04);
    border: 1px solid rgba(7, 20, 40, 0.08);
    margin-bottom: 1rem;
}

.auth-portal-lockout__timer-label {
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.auth-portal-lockout__timer-value {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--alcros-navy-mid);
    line-height: 1.1;
}

.auth-portal-lockout__hint {
    font-size: 0.625rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    margin: 0;
}

@media (max-width: 639px) {
    html,
    body.auth-portal {
        height: auto;
        min-height: 100%;
        overflow: auto;
    }

    .auth-portal {
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
    }

    .auth-portal-main {
        align-items: flex-start;
        padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        overflow: visible;
    }

    .auth-portal-header-inner {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .auth-portal-brand-logo {
        width: 2.5rem;
        height: 2.5rem;
    }

    .auth-portal-card-logo {
        width: 4.75rem;
        height: 4.75rem;
    }

    .auth-portal-brand-title {
        font-size: 0.875rem;
    }

    .auth-portal-brand-subtitle {
        font-size: 0.5625rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .auth-portal-header-link {
        padding: 0.45rem 0.75rem;
        font-size: 0.625rem;
    }

    .auth-portal-card {
        border-radius: 1.25rem;
    }

    .auth-portal-card-footer {
        padding: 1rem 1.25rem;
    }
}
