/**
 * ALS Web Application - Authentication Theme (Login & Register)
 * Material Design Aesthetic: Unrounded sharp geometry (4px radius), layered elevations,
 * touch-friendly targets, and 100% mobile-responsive layout.
 */

:root {
    --auth-primary: #0d47a1;
    --auth-primary-hover: #0a3880;
    --auth-primary-light: #e3f2fd;
    --auth-accent: #1976d2;
    --auth-bg-gradient: linear-gradient(135deg, #0b192c 0%, #102a43 45%, #1e3e62 100%);
    --auth-surface: #ffffff;
    --auth-border: #cbd5e1;
    --auth-text-main: #0f172a;
    --auth-text-muted: #64748b;
    --auth-radius: 4px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
}

body.auth-page {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--auth-bg-gradient) !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
    color: var(--auth-text-main);
}

/* Ambient glow orbs - strictly clipped */
.auth-glow-1 {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.22) 0%, rgba(14, 165, 233, 0) 70%);
    pointer-events: none;
    filter: blur(40px);
    z-index: 1;
}

.auth-glow-2 {
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 70%);
    pointer-events: none;
    filter: blur(50px);
    z-index: 1;
}

.auth-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    opacity: 0.6;
    z-index: 2;
}

/* Auth Card Wrapper */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    margin: 0 auto;
}

.auth-wrapper-lg {
    max-width: 560px;
}

/* Material Auth Card - Sharp 4px geometry */
.auth-card {
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid var(--auth-accent);
    overflow: hidden;
    width: 100%;
}

.auth-card-body {
    padding: 2.25rem 2rem 2rem 2rem;
}

/* Branding Header */
.auth-brand-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

/* Unrounded Material Logo Container */
.auth-brand-logo-container {
    width: 68px;
    height: 68px;
    margin: 0 auto 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: var(--auth-radius);
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 8px;
}

.auth-brand-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.auth-brand-subtitle {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    margin-bottom: 0;
}

/* Form Labels */
.auth-card .form-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

/* Material Input Groups - 4px radius, clear outline */
.auth-input-group {
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-border);
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    overflow: hidden;
    min-height: 44px;
    display: flex;
    align-items: stretch;
}

.auth-input-group:focus-within {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.25);
    background: #ffffff;
}


    .auth-input-group-text,
    .input-group.auth-input-group>.auth-input-group-text {
        background: transparent !important;
        border: none !important;
        color: var(--auth-text-muted);
        padding: 0 0.75rem;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .auth-input-group:focus-within .auth-input-group-text {
        color: var(--auth-accent) !important;
    }


        .auth-form-control,
        .input-group.auth-input-group>.auth-form-control {
            border: none !important;
            background: transparent !important;
            padding: 0.65rem 0.75rem;
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--auth-text-main) !important;
            box-shadow: none !important;
            outline: none !important;
            flex: 1 1 auto;
            width: 1%;
        }


            .auth-form-control:focus,
            .input-group.auth-input-group>.auth-form-control:focus {
                background: transparent !important;
                box-shadow: none !important;
                outline: none !important;
            }

            .auth-form-control::placeholder {
                color: #94a3b8;
                font-weight: 400;
            }

            /* Password Toggle Button */
                .auth-toggle-password-btn,
                .input-group.auth-input-group>.auth-toggle-password-btn {
                    background: transparent !important;
                    border: none !important;
                    color: var(--auth-text-muted);
                    padding: 0 0.85rem;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    cursor: pointer;
                    transition: color 0.15s ease;
                }

                .auth-toggle-password-btn:hover {
                    color: #0f172a;
                }

                /* Material Elevated Submit Button */
                .auth-btn-submit {
                    background: var(--auth-primary);
                    border: none;
                    color: #ffffff;
                    font-weight: 700;
                    font-size: 0.875rem;
                    letter-spacing: 0.05em;
                    text-transform: uppercase;
                    padding: 0.75rem 1.25rem;
                    border-radius: var(--auth-radius);
                    box-shadow: 0 2px 4px rgba(13, 71, 161, 0.3);
                    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    gap: 0.5rem;
                    min-height: 44px;
                    cursor: pointer;
                }

                .auth-btn-submit:hover {
                    background: var(--auth-primary-hover);
                    box-shadow: 0 4px 8px rgba(13, 71, 161, 0.4);
                    color: #ffffff;
                }

                .auth-btn-submit:active {
                    box-shadow: 0 1px 2px rgba(13, 71, 161, 0.3);
                    transform: translateY(1px);
                }

                .auth-btn-submit:disabled {
                    opacity: 0.75;
                    cursor: not-allowed;
                    box-shadow: none;
                    transform: none;
                }

                /* Custom Status Alerts - Sharp 4px */
                .auth-alert-custom {
                    border-radius: var(--auth-radius);
                    padding: 0.75rem 0.85rem;
                    font-size: 0.85rem;
                    display: flex;
                    align-items: flex-start;
                    gap: 0.65rem;
                    border: 1px solid;
                    margin-bottom: 1.25rem;
                }

                .auth-alert-danger {
                    background-color: #fef2f2;
                    border-color: #fecaca;
                    color: #991b1b;
                }

                .auth-alert-success {
                    background-color: #f0fdf4;
                    border-color: #bbf7d0;
                    color: #166534;
                }

                .auth-alert-info {
                    background-color: #eff6ff;
                    border-color: #bfdbfe;
                    color: #1e40af;
                }

                .auth-alert-icon {
                    font-size: 1.1rem;
                    line-height: 1;
                    margin-top: 1px;
                    flex-shrink: 0;
                }

                /* Footer Link Section */
                .auth-footer {
                    margin-top: 1.5rem;
                    padding-top: 1.25rem;
                    border-top: 1px solid #f1f5f9;
                    text-align: center;
                }

                .auth-link {
                    color: var(--auth-accent);
                    font-weight: 700;
                    text-decoration: none;
                    transition: color 0.15s ease;
                }

                .auth-link:hover {
                    color: var(--auth-primary-hover);
                    text-decoration: underline;
                }

                /* Bottom Portal Metadata */
                .auth-portal-meta {
                    text-align: center;
                    margin-top: 1.25rem;
                    color: rgba(255, 255, 255, 0.75);
                    font-size: 0.75rem;
                    letter-spacing: 0.02em;
                }

                /* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
                @media (max-width: 576px) {
                    body.auth-page {
                        padding: 1.25rem 0.85rem;
                        align-items: center;
                        justify-content: center;
                    }

                    .auth-wrapper,
                    .auth-wrapper-lg {
                        max-width: 100%;
                        width: 100%;
                        margin: 0 auto;
                    }

                    .auth-card {
                        border-radius: var(--auth-radius);
                    }

                    .auth-card-body {
                        padding: 1.5rem 1.15rem 1.25rem 1.15rem;
                    }

                    .auth-brand-logo-container {
                        width: 58px;
                        height: 58px;
                        margin-bottom: 0.65rem;
                    }

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

                    .auth-brand-subtitle {
                        font-size: 0.8rem;
                    }

                    /* Set 16px to prevent iOS Safari auto-zooming on focus */
                    .auth-form-control {
                        font-size: 16px;
                    }

                    /* Completely hide glowing orbs on mobile to avoid any horizontal viewport overflow */
                    .auth-glow-1,
                    .auth-glow-2 {
                        display: none;
                    }

                    .auth-portal-meta {
                        margin-top: 1rem;
                        font-size: 0.725rem;
                    }
                }