/* ENERTIA DIGITAL ECOSYSTEM 2026
   Theme: Industrial Luxury & High-Voltage Precision 
*/

:root {
    /* Brand Palette */
    --gold-primary: #D4AF37;
    --gold-dark: #996515;
    --gold-glow: rgba(212, 175, 55, 0.25);
    
    /* NEW: Deep Charcoal Foundation */
    --obsidian: #121212;         /* Softer than pure black */
    --charcoal-light: #1A1A1A;   /* For subtle depth */
    
    /* Surface Colors - Adjusted for Gray */
    --glass-bg: rgba(30, 30, 30, 0.7); /* Slightly lighter glass base */
    --glass-border: rgba(212, 175, 55, 0.2);
    --input-bg: rgba(0, 0, 0, 0.3);
    
    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.5s var(--ease-out-expo);
}

/* ================= BASE ARCHITECTURE ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    /* Use a gradient to create depth */
    background: radial-gradient(circle at center, var(--charcoal-light) 0%, var(--obsidian) 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: #ffffff;
}

/* Atmospheric Background - Adjusted opacity for better visibility on gray */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.1), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.06), transparent 50%);
    animation: ionDrift 20s infinite alternate linear;
    z-index: -1;
}

@keyframes ionDrift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-2%, -2%); }
}

/* ================= AUTHORIZATION CARD ================= */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    perspective: 1000px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 60px 45px;
    text-align: center;
    /* Deeper shadow to create lift from the gray floor */
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 
                inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: cardRise 1.2s var(--ease-out-expo);
    position: relative;
}
@keyframes cardRise {
    from { opacity: 0; transform: translateY(60px) rotateX(-10deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.login-logo {
    width: 100px;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 20px var(--gold-glow));
    transition: var(--transition);
}

.login-card h2 {
    font-family: 'Poppins', sans-serif;
    color: var(--gold-primary);
    font-size: 1.8rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.login-card p {
    color: #8a8a8a;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 40px;
}

/* ================= INPUT ARCHITECTURE ================= */
.input-group { margin-bottom: 20px; }

input {
    width: 100%;
    padding: 16px 20px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.02);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08);
}

.password-container {
    position: relative;
    margin-bottom: 30px;
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
}

.toggle-password:hover { opacity: 1; color: var(--gold-primary); }

/* ================= ACTION BUTTONS ================= */
button {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(153, 101, 21, 0.4);
}

/* The Metallic Sweep Animation */
button::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(25deg);
    transition: 0.7s;
}

button:hover::after { left: 150%; }

/* ================= UTILITIES ================= */
.signup-text { margin-top: 30px; font-size: 0.8rem; color: #666; }
.signup-text a { color: var(--gold-primary); text-decoration: none; font-weight: 600; }

/* ================= PREMIUM DARK OVERLAY ================= */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #050505; /* Matches your --obsidian variable */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Ensure it stays on top */
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.loading-logo {
    width: 120px;
    height: auto;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.overlay-label {
    font-family: 'Poppins', sans-serif;
    color: #D4AF37;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 12px;
    text-indent: 12px; /* Centers the spaced-out text */
    text-transform: uppercase;
}

/* ================= FORM SPACING OPTIMIZATION ================= */
#agentSignupForm {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Consistent spacing between all inputs */
}

#agentSignupForm input {
    margin-bottom: 0; /* Let the gap handle spacing */
}

/* Ensure the card doesn't get cut off on small laptops */
@media (max-height: 850px) {
    body {
        height: auto;
        padding: 40px 0;
        overflow-y: auto;
    }
    .login-card {
        padding: 40px 30px;
    }
    .login-logo {
        width: 80px;
        margin-bottom: 15px;
    }
}

/* Success/Error Message Styling */
.error {
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 1.2em; /* Prevents card jumping when text appears */
    transition: color 0.3s ease;
}

/* Custom Highlight for auto-filled fields */
input.auto-filled {
    border-color: var(--gold-primary) !important;
    background: rgba(212, 175, 55, 0.05) !important;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 10px rgba(212, 175, 55, 0.2)); }
    50% { transform: scale(1.05); filter: brightness(1.3) drop-shadow(0 0 30px rgba(212, 175, 55, 0.5)); }
}
.shake {
    animation: shakeEffect 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeEffect {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}