/* =========================================================================
   AUTH PAGES — shared styles for admin_login.html and secure_user_login.html
   (moved from duplicated inline <style> blocks; load AFTER design_system.css)
   ========================================================================= */

/* ========================================
   THEME VARIABLES
   ======================================== */

:root {
    /* Light Theme (default) */
    --auth-bg: #f1f5f9;
    --auth-bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --auth-card-bg: rgba(255, 255, 255, 0.95);
    --auth-card-border: rgba(0, 0, 0, 0.08);
    --auth-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --auth-blur-1: rgba(59, 130, 246, 0.15);
    --auth-blur-2: rgba(100, 116, 139, 0.1);

    --auth-text-primary: #0f172a;
    --auth-text-secondary: #64748b;
    --auth-text-tertiary: #56657a;

    --auth-input-bg: rgba(255, 255, 255, 0.8);
    --auth-input-border: #e2e8f0;
    --auth-input-focus-border: #2563eb;
    --auth-input-text: #0f172a;
    --auth-input-placeholder: #64748b;

    --auth-btn-bg: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --auth-btn-hover-bg: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    --auth-btn-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);

    --auth-divider: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1) 50%, transparent);
    --auth-link: #2563eb;
    --auth-link-hover: #1d4ed8;
    --auth-link-muted: #64748b;

    --auth-alert-error-bg: rgba(239, 68, 68, 0.1);
    --auth-alert-error-border: rgba(239, 68, 68, 0.2);
    --auth-alert-error-text: #dc2626;
    --auth-alert-info-bg: rgba(59, 130, 246, 0.1);
    --auth-alert-info-border: rgba(59, 130, 246, 0.2);
    --auth-alert-info-text: #2563eb;

    --auth-success: #16a34a;
}

[data-theme="dark"] {
    /* Dark Theme */
    --auth-bg: #0f172a;
    --auth-bg-gradient: linear-gradient(135deg,
        #0f172a 0%,
        #1e293b 25%,
        #334155 50%,
        #1e3a5f 75%,
        #1e293b 100%
    );
    --auth-card-bg: rgba(255, 255, 255, 0.08);
    --auth-card-border: rgba(255, 255, 255, 0.15);
    --auth-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --auth-blur-1: rgba(59, 130, 246, 0.4);
    --auth-blur-2: rgba(71, 85, 105, 0.4);

    --auth-text-primary: #f8fafc;
    --auth-text-secondary: #94a3b8;
    --auth-text-tertiary: #8a98ad;

    --auth-input-bg: rgba(255, 255, 255, 0.06);
    --auth-input-border: rgba(255, 255, 255, 0.12);
    --auth-input-focus-border: rgba(59, 130, 246, 0.5);
    --auth-input-text: #f1f5f9;
    --auth-input-placeholder: #8a98ad;

    --auth-btn-bg: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --auth-btn-hover-bg: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    --auth-btn-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);

    --auth-divider: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15) 50%, transparent);
    --auth-link: #60a5fa;
    --auth-link-hover: #93c5fd;
    --auth-link-muted: #64748b;

    --auth-alert-error-bg: rgba(239, 68, 68, 0.15);
    --auth-alert-error-border: rgba(239, 68, 68, 0.3);
    --auth-alert-error-text: #fca5a5;
    --auth-alert-info-bg: rgba(59, 130, 246, 0.15);
    --auth-alert-info-border: rgba(59, 130, 246, 0.3);
    --auth-alert-info-text: #93c5fd;

    --auth-success: #4ade80;
}

/* ========================================
   AUTH SHELL
   ======================================== */

.auth-shell-v2 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--auth-bg-gradient);
    transition: background 0.3s ease;
}

/* Animated gradient for dark theme */
[data-theme="dark"] .auth-shell-v2 {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Decorative blur shapes */
.auth-shell-v2::before,
.auth-shell-v2::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.auth-shell-v2::before {
    width: 400px;
    height: 400px;
    background: var(--auth-blur-1);
    top: -100px;
    right: -100px;
    opacity: 0.6;
}

.auth-shell-v2::after {
    width: 350px;
    height: 350px;
    background: var(--auth-blur-2);
    bottom: -80px;
    left: -80px;
    opacity: 0.5;
}

/* ========================================
   TOP BAR (Language + Theme)
   ======================================== */

.auth-top-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.top-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--auth-card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--auth-card-border);
    border-radius: 8px;
    color: var(--auth-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.top-bar-btn:hover {
    background: var(--auth-input-bg);
    color: var(--auth-text-primary);
    transform: translateY(-1px);
}

.top-bar-btn.active {
    background: var(--auth-btn-bg);
    color: white;
    border-color: transparent;
}

.theme-toggle {
    font-size: 16px;
}

/* ========================================
   GLASS CARD
   ======================================== */

.auth-card-v2 {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.glass-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-card-border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--auth-card-shadow);
    transition: all 0.3s ease;
}

/* Light theme: add subtle inner glow */
[data-theme="light"] .glass-card {
    box-shadow:
        var(--auth-card-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Dark theme: add top highlight */
[data-theme="dark"] .glass-card {
    box-shadow:
        var(--auth-card-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.glass-card h1 {
    color: var(--auth-text-primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    transition: color 0.3s ease;
}

.glass-card .subtitle {
    color: var(--auth-text-secondary);
    font-size: 14px;
    margin-top: 8px;
    transition: color 0.3s ease;
}

.glass-card .form-label {
    color: var(--auth-text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
    transition: color 0.3s ease;
}

/* ========================================
   FORM INPUTS
   ======================================== */

.glass-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--auth-input-text);
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    outline: none;
}

.glass-input::placeholder {
    color: var(--auth-input-placeholder);
}

.glass-input:focus {
    border-color: var(--auth-input-focus-border);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .glass-input:focus {
    background: rgba(255, 255, 255, 0.1);
}

.glass-input.is-valid {
    border-color: var(--auth-success);
}

/* Input with button */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn .glass-input {
    flex: 1;
}

.glass-btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 10px;
    color: var(--auth-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.glass-btn-icon:hover {
    color: var(--auth-text-primary);
    border-color: var(--auth-input-focus-border);
}

/* ========================================
   PRIMARY BUTTON
   ======================================== */

.glass-btn-primary {
    width: 100%;
    height: 46px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: var(--auth-btn-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.glass-btn-primary:hover:not(:disabled) {
    background: var(--auth-btn-hover-bg);
    transform: translateY(-1px);
    box-shadow: var(--auth-btn-shadow);
}

.glass-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.glass-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   DIVIDER & INFO
   ======================================== */

.glass-divider {
    height: 1px;
    background: var(--auth-divider);
    margin: 24px 0;
}

.info-label {
    color: var(--auth-text-tertiary);
    font-size: 12px;
    transition: color 0.3s ease;
}

.mirrors-block {
    padding: 6px 0;
}

.mirror-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 6px;
}

.mirror-link {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: var(--auth-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.mirror-link.active {
    color: var(--auth-text-primary);
    font-weight: 600;
}

/* ========================================
   LINKS
   ======================================== */

.glass-link {
    color: var(--auth-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.glass-link:hover {
    color: var(--auth-link-hover);
}

.glass-link-muted {
    color: var(--auth-link-muted);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.glass-link-muted:hover {
    color: var(--auth-text-secondary);
}

/* ========================================
   ALERTS
   ======================================== */

.glass-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.glass-alert-error {
    background: var(--auth-alert-error-bg);
    border: 1px solid var(--auth-alert-error-border);
    color: var(--auth-alert-error-text);
}

.glass-alert-info {
    background: var(--auth-alert-info-bg);
    border: 1px solid var(--auth-alert-info-border);
    color: var(--auth-alert-info-text);
}

/* ========================================
   HINT TEXT
   ======================================== */

.hint-text {
    color: var(--auth-text-tertiary);
    font-size: 11px;
    text-align: center;
    margin-top: 6px;
    transition: color 0.3s ease;
}

/* ========================================
   UTILITIES
   ======================================== */

.mb-6 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }

/* ========================================
   ANIMATIONS
   ======================================== */

.glass-card {
    opacity: 0;
    transform: translateY(20px);
    animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.1s;
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    .auth-shell-v2 {
        padding: 16px;
        padding-top: 60px;
    }

    .glass-card {
        padding: 24px;
        border-radius: 12px;
    }

    .glass-card h1 {
        font-size: 20px;
    }

    .auth-top-bar {
        top: 12px;
        right: 12px;
    }
}

/* =========================================================================
   ADMIN LOGIN VARIANT (body.auth-admin) — narrower card, smaller title
   ========================================================================= */

.glass-card h1 .admin-badge {
    display: inline-block;
    background: var(--auth-btn-bg);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.05em;
}

.support-text {
    color: var(--auth-text-tertiary);
    font-size: 12px;
    transition: color 0.3s ease;
}

.auth-admin .auth-card-v2 {
    max-width: 400px;
}

.auth-admin .glass-card h1 {
    font-size: 22px;
}

@media (max-width: 480px) {
    .auth-admin .glass-card h1 {
        font-size: 18px;
    }
}
