/* Stenzo Tech Authentication - 3D Dark Glass Premium */

:root {
    /* Core Colors */
    --primary-hue: 250;
    --primary: hsl(var(--primary-hue), 70%, 60%);
    --secondary: hsl(300, 70%, 60%);

    /* Animation */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --bg-gradient: radial-gradient(circle at top center, #1e1b4b, #0f172a);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-border: var(--primary);

    --blob-opacity: 1;
}

/* Light Theme */
[data-theme="light"] {
    --bg-gradient: radial-gradient(circle at top center, #e0e7ff, #f3f4f6);
    --text-primary: #020617;
    /* Darker Slate - Almost Black */
    --text-secondary: #334155;
    /* Dark Slate */
    --text-muted: #475569;
    /* Medium Slate */

    --glass-bg: rgba(255, 255, 255, 0.75);
    /* More opaque */
    --glass-border: rgba(30, 41, 59, 0.2);
    --glass-highlight: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    --input-bg: rgba(255, 255, 255, 0.7);
    --input-border: rgba(71, 85, 105, 0.3);
    --input-focus-border: var(--primary);

    --blob-opacity: 0.9;
}

/* Vintage Theme (Retrowave / Retro Paper) */
[data-theme="vintage"] {
    --bg-gradient: radial-gradient(circle at top center, #fdf6e3, #f0e6d2);
    /* Warm Paper */
    --text-primary: #2d1b0e;
    /* Deepest Espresso */
    --text-secondary: #5d4037;
    /* Dark Leather */
    --text-muted: #795548;
    /* Dark Clay */

    --glass-bg: rgba(255, 253, 240, 0.75);
    /* More opaque */
    --glass-border: rgba(34, 25, 20, 0.2);
    --glass-highlight: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(45, 27, 14, 0.15);

    --input-bg: rgba(255, 253, 240, 0.6);
    --input-border: rgba(93, 64, 55, 0.3);
    --input-focus-border: #8d6e63;

    --primary: #5d4037;
    --secondary: #8d6e63;
    --blob-opacity: 0.9;
}

body {
    /* Theme-aware Background */
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;

    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    /* DEFAULT: No scroll (Login/Forgot) */
    position: relative;
    margin: 0;
    padding: 0;
    transition: background 0.5s ease;
}

body.auth-scrollable {
    overflow-y: auto;
    /* ENABLE scroll for Register */
    padding: 2rem 0;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: auto;
    padding: 1rem;
}

/* Footer Logic */
.auth-footer {
    z-index: 10;
    background: transparent !important;
    color: var(--text-muted);

    /* Default: Fixed at bottom for Login/Forgot */
    position: fixed;
    bottom: 0;
    width: 100%;
    padding-bottom: 1rem;
    pointer-events: none;
}

.auth-footer * {
    pointer-events: auto;
}

/* Fix for High Zoom / Low Vertical Height */
@media (max-height: 800px) {
    .auth-footer {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
    }

    body {
        overflow-y: auto;
    }
}

/* Scrollable Pages: Footer flows naturally */
body.auth-scrollable .auth-footer {
    position: relative;
    bottom: auto;
    width: auto;
    padding-bottom: 1rem;
    margin-top: 2rem;
}

/* 3D Floating Blobs - RESTORED & EDGE POSITIONED & DISTORTED */
.auth-bg-shape {
    display: block;
    position: fixed;
    /* Keep fixed to prevent scroll */
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    z-index: 1;
    /* 3D Effect */
    filter: blur(10px);
    opacity: var(--blob-opacity);
    /* Variable opacity */
    animation: float 20s infinite ease-in-out alternate;
    box-shadow:
        inset -20px -20px 50px rgba(0, 0, 0, 0.5),
        inset 20px 20px 50px rgba(255, 255, 255, 0.2),
        0 0 50px rgba(var(--color-rgb), 0.3);
}

/* Individual Blob Configurations - Pushed to Edges */
.shape-1 {
    --color-rgb: 99, 102, 241;
    /* Indigo */
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 30% 30%, #a5b4fc, #4f46e5);
    top: -100px;
    left: -100px;
    /* Top Left Corner */
    animation-duration: 25s;
}

.shape-2 {
    --color-rgb: 236, 72, 153;
    /* Pink */
    width: 350px;
    height: 350px;
    background: radial-gradient(circle at 30% 30%, #fbcfe8, #db2777);
    bottom: -100px;
    right: -100px;
    /* Bottom Right Corner */
    animation-duration: 28s;
    animation-delay: -5s;
}

.shape-3 {
    --color-rgb: 59, 130, 246;
    /* Blue */
    width: 250px;
    height: 250px;
    background: radial-gradient(circle at 30% 30%, #93c5fd, #2563eb);
    top: 50%;
    right: -100px;
    /* Middle Right Edge */
    transform: translateY(-50%);
    animation-duration: 30s;
    animation-delay: -10s;
}

.shape-4 {
    --color-rgb: 20, 184, 166;
    /* Teal */
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, #99f6e4, #0d9488);
    bottom: 10%;
    left: -80px;
    /* Bottom Left Edge */
    animation-duration: 22s;
    animation-delay: -15s;
}

.shape-5 {
    --color-rgb: 249, 115, 22;
    /* Orange */
    width: 180px;
    height: 180px;
    background: radial-gradient(circle at 30% 30%, #fdba74, #f97316);
    top: -50px;
    right: -50px;
    animation-duration: 26s;
    animation-delay: -2s;
}

.shape-6 {
    --color-rgb: 139, 92, 246;
    /* Violet */
    width: 180px;
    height: 180px;
    background: radial-gradient(circle at 30% 30%, #ddd6fe, #7c3aed);
    top: 50%;
    left: -80px;
    /* Middle Left Edge */
    transform: translateY(-50%);
    animation-duration: 32s;
    animation-delay: -8s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    }

    33% {
        transform: translate(30px, -40px) rotate(10deg) scale(1.05);
        border-radius: 40% 60% 54% 46% / 49% 60% 40% 51%;
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg) scale(0.95);
        border-radius: 73% 27% 59% 41% / 57% 59% 41% 43%;
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    }
}

/* Layout Container */
.login-container {
    width: 100%;
    max-width: 480px;
    /* Slightly wider for better spacing */
    padding: 1.5rem;
    padding: 1.5rem;
    z-index: 20;
    perspective: 1000px;
    /* For 3D card effect */
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    /* Use variable */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);

    border-radius: 24px;
    padding: 3rem 2.5rem;

    box-shadow:
        var(--glass-shadow),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);

    transform-style: preserve-3d;
    transition: var(--transition-smooth);

    /* Entrance Animation */
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: cardEnter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Typography */
.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    /* Variable Gradient */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Logo */
.auth-logo {
    width: 160px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-smooth);
    width: 100%;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Password Input */
.password-wrapper {
    position: relative;
}

.password-input {
    padding-right: 3rem;
}

.password-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 5;
}

.password-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.password-btn:hover {
    color: #fff;
}

/* Buttons */
.btn-auth {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}

.btn-auth:hover::before {
    left: 100%;
}

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

.btn-auth-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-auth-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    color: #fff;
    border-color: #fff;
}

/* Links */
.auth-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
}

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

.auth-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(165, 180, 252, 0.5);
}

/* Back to Login Hover Animation */
.back-to-login {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-login i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-login:hover i {
    transform: translateX(-5px);
}

/* Footer */
/* Footer styles moved up to body section for context logic */

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-link:hover {
    color: #fff;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .glass-card {
        padding: 2rem 1.5rem;
    }

    .auth-bg-shape {
        opacity: 0.5;
        /* Reduce distraction on mobile */
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 100;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: var(--glass-highlight);
    box-shadow: 0 0 15px var(--primary);
}

/* SweetAlert2 Glass Theme */
.swal2-popup {
    background: rgba(15, 23, 42, 0.8) !important;
    /* Fallback/Dark base */
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    border-top: 1px solid var(--glass-highlight) !important;
    border-radius: 24px !important;
    padding: 2rem !important;
    color: var(--text-primary) !important;
    box-shadow: var(--glass-shadow) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
    font-family: 'Outfit', sans-serif !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
    font-family: 'Outfit', sans-serif !important;
}

.swal2-icon.swal2-error {
    border-color: #f87171 !important;
    color: #f87171 !important;
}

.swal2-icon.swal2-question {
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: none !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4) !important;
}