:root {
    --Angels-green: #09a94b;
    --Angels-green-hover: #078c3e;
    --cyber-blue: #0084ff;
    --bg-deep: #040812;
    --bg-slate: #0b111e;
    --page-overlay: rgba(4, 8, 18, 0.85);
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --card-bg: rgba(11, 17, 30, 0.92);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --field-bg: #151d2a;
    --field-bg-focus: #1c2738;
    --panel-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.7);
    --toggle-bg: rgba(15, 23, 42, 0.76);
    --toggle-border: rgba(255, 255, 255, 0.12);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
    --bg-deep: #f1f5f9;
    --bg-slate: #ffffff;
    --page-overlay: rgba(241, 245, 249, 0.75);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(15, 23, 42, 0.12);
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --field-bg: #f8fafc;
    --field-bg-focus: #ffffff;
    --panel-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
    --toggle-bg: rgba(255, 255, 255, 0.92);
    --toggle-border: rgba(15, 23, 42, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(var(--page-overlay), var(--page-overlay)), url('/static/media/pages/onepageimg/blackbox_bg.png') center/cover;
    background-color: var(--bg-deep);
    color: var(--text-main);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
}

/* --- ANIMATIONS --- */
.gs-fade-in {
    animation: avwFadeIn 0.5s ease-in-out forwards;
    opacity: 0;
}

@keyframes avwFadeIn {
    to {
        opacity: 1;
    }
}

/* --- AUTH CARD LAYOUT --- */
.auth-container {
    width: 100%;
    max-width: 1020px;
    min-height: 580px;
    height: auto;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    box-shadow: var(--panel-shadow);
    overflow: hidden;
    position: relative;
    margin: 20px auto;
}

@media (max-width: 991px) {
    .auth-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        margin: 10px auto;
        border-radius: 20px;
    }
    .auth-sidebar {
        display: none;
    }
}

/* Left Sidebar (Hero) */
.auth-sidebar {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 50%, #09a94b 100%);
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.sidebar-content {
    position: relative;
    z-index: 1;
    text-align: left;
}

.sidebar-logo {
    width: 110px;
    margin-bottom: 24px;
}

.sidebar-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.sidebar-image {
    width: 100%;
    max-width: 280px;
    opacity: 0.95;
    display: block;
    margin: 16px auto;
    object-fit: contain;
}

.sidebar-text {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.55;
    margin-bottom: 16px;
}

/* Right Section (Forms) */
.auth-form-section {
    padding: 44px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
}

.form-content-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.form-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-main);
    letter-spacing: -0.4px;
}

.form-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Form Grid Helpers */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 576px) {
    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* --- FORM ELEMENTS --- */
.form-group {
    margin-bottom: 16px;
    position: relative;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.auth-input {
    width: 100%;
    background: var(--field-bg);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    padding-left: 44px;
    padding-right: 44px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.auth-input:focus {
    outline: none;
    border-color: var(--Angels-green);
    background: var(--field-bg-focus);
    box-shadow: 0 0 20px rgba(9, 169, 75, 0.25);
}

.auth-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--text-main);
}

.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.78rem;
}

.password-requirements .requirement {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.auth-meta-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* --- BUTTONS --- */
.btn-auth {
    width: 100%;
    background: linear-gradient(135deg, #09a94b 0%, #0084ff 100%);
    color: white;
    border: none;
    padding: 13px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(9, 169, 75, 0.3);
}

.btn-auth:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(9, 169, 75, 0.4);
}

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

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 0;
}

.auth-divider span {
    padding: 0 12px;
}

.googleBtn {
    width: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.googleBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-link {
    color: #0084ff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Theme Toggle Button */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--toggle-bg);
    border: 1px solid var(--toggle-border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* --- SPINNER OVERLAY --- */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 18, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.spinner-overlay .spinner-border {
    width: 3.2rem;
    height: 3.2rem;
    border-width: 0.28em;
    color: #09A94B !important;
}

/* --- ALERT NOTIFICATION SYSTEM --- */
.alert-stack-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.alert-quantum {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px 18px;
    color: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-quantum.show {
    transform: translateX(0);
}

.alert-quantum .alert-icon {
    font-size: 1.3rem;
    margin-top: 1px;
}

.alert-success .alert-icon { color: #09A94B; }
.alert-error .alert-icon { color: #ef4444; }
.alert-info .alert-icon { color: #0084FF; }

.alert-quantum .alert-text {
    flex: 1;
}

.alert-quantum .alert-title {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.alert-quantum .alert-message {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
}

.alert-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.alert-close-btn:hover { color: #ffffff; }

.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.alert-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #09A94B, #0084FF);
    transition: width linear;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 991px) {
    body {
        padding: 16px 12px;
        align-items: flex-start;
    }
    .auth-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        margin: 12px auto;
        border-radius: 20px;
    }
    .auth-sidebar {
        display: none !important;
    }
    .auth-form-section {
        padding: 36px 28px;
    }
    .auth-theme-toggle {
        top: 14px;
        right: 14px;
        padding: 6px 14px;
        font-size: 0.76rem;
    }
}

@media (max-width: 576px) {
    body {
        padding: 10px 8px;
    }
    .auth-container {
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin: 6px auto;
    }
    .auth-form-section {
        padding: 26px 16px;
    }
    .form-title {
        font-size: 1.5rem;
    }
    .form-subtitle {
        font-size: 0.82rem;
        margin-bottom: 16px;
    }
    .form-group {
        margin-bottom: 14px;
    }
    .auth-input {
        font-size: 16px; /* Prevents auto-zoom on iOS devices */
        padding: 11px 14px 11px 40px;
    }
    .btn-auth {
        padding: 13px;
        font-size: 0.88rem;
    }
    .alert-stack-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
}
