/* app/static/css/pages/auth.css */

/* --- Typography & Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    height: 100vh;
    margin: 0;
    /* Use Design System Surfaces */
    background: var(--bg-card);
    color: var(--text-main);
    overflow: hidden;
}

.split-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* =========================================
   LEFT PANEL: Branding
   ========================================= */
.branding-panel {
    flex-basis: 50%;
    /* Use specific auth variables for the gradient */
    background: radial-gradient(circle at 0% 0%, var(--auth-bg-gradient-start) 0%, var(--auth-bg-gradient-end) 100%);
    padding: 0 6em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border-right: 1px solid var(--border-medium);
    overflow: hidden;
}

/* The Decorative Glow */
.branding-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 800px;
    height: 800px;
    /* Use the specific variable defined for this purpose */
    background: radial-gradient(circle, var(--auth-circle-color) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content sits above the circle */
.branding-content, 
.branding-logo, 
.branding-panel h1, 
.description, 
.features {
    position: relative;
    z-index: 1; 
}

.branding-logo { width: 80px; margin-bottom: 2.5em; display: block; }

.branding-panel h1 {
    font-size: 3.5rem;
    color: var(--text-main);
    margin: 0 0 0.25em 0;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.description {
    font-size: 1.25rem;
    color: var(--text-subtle);
    line-height: 1.6;
    margin-bottom: 4em;
    max-width: 520px;
    font-weight: 400;
}

/* Features List */
.features { list-style: none; padding: 0; margin: 0; }
.features li { display: flex; align-items: flex-start; margin-bottom: 2.5em; }

.features li i {
    font-size: 1rem;
    /* Use Brand Primary */
    color: var(--brand-primary);
    background: var(--bg-card);
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 20px; flex-shrink: 0;
    
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.features li div { display: flex; flex-direction: column; justify-content: center; min-height: 44px; }
.features li strong { font-size: 1rem; font-weight: 600; color: var(--text-main); margin-bottom: 3px; }
.features li small { font-size: 0.9rem; color: var(--text-subtle); line-height: 1.4; }


/* =========================================
   RIGHT PANEL: Login Form
   ========================================= */
.login-panel {
    flex-basis: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-card);
    padding: 2em;
    position: relative;
}

.login-panel .lang-dropdown-wrapper {
    position: absolute;
    top: 24px;
    right: 24px;
}


/* --- Auth Card --- */
.card { width: 100%; max-width: 400px; text-align: left; }
.card img.logo { display: none; }

h2 {
    margin-bottom: 0.5rem; font-weight: 700; font-size: 1.875rem;
    color: var(--text-main); letter-spacing: -0.02em;
}
.card .subtitle { color: var(--text-subtle); margin-bottom: 2.5em; font-size: 1rem; font-weight: 400; }

form { display: flex; flex-direction: column; gap: 16px; }

/* --- PREMIUM INPUTS --- */
.input-group { position: relative; }

.input-icon {
    position: absolute;
    left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-disabled);
    font-size: 1.1rem;
    transition: color 0.2s; pointer-events: none;
}

input {
    width: 100%; box-sizing: border-box;
    padding: 12px 16px 12px 48px; 
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    font-size: 0.95rem; color: var(--text-main); background: var(--bg-input);
    transition: all 0.2s ease-in-out;
    font-family: 'Inter', sans-serif;
}

input::placeholder { color: var(--text-disabled); }
input:hover { border-color: var(--border-strong); }

/* Focus Glow using Brand Color */
input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--input-focus-ring); /* Uses the new variable */
}
input:focus + .input-icon { color: var(--brand-primary); }

#confirm-password-group { display: none; }

/* --- Primary Button --- */
button[type="submit"] {
    width: 100%;
    background: var(--brand-primary);
    color: var(--text-on-accent);
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem; font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s;
    /* Dynamically calculate colored shadow using RGB variable */
    box-shadow: 0 4px 6px -1px rgba(var(--brand-primary-rgb), 0.3), 0 2px 4px -1px rgba(var(--brand-primary-rgb), 0.15);
}

button[type="submit"]:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -1px rgba(var(--brand-primary-rgb), 0.4);
}

/* --- Google Button (Secondary Action) --- */
.google-login {
    width: 100%;
    background: var(--google-btn-bg);
    color: var(--google-btn-text);
    border: 1px solid var(--google-btn-border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 12px;
    font-weight: 500; font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    margin-top: 24px;
    cursor: pointer; transition: all 0.2s;
}

.google-login:hover {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.google-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Footer */
.toggle { text-align: center; margin-top: 24px; font-size: 0.9rem; color: var(--text-subtle); }
.toggle a { color: var(--brand-primary); font-weight: 600; text-decoration: none; margin-left: 4px; }
.toggle a:hover { text-decoration: underline; color: var(--brand-primary-hover); }

.error {
    background: #fef2f2; /* Explicit error bg often clearer than variable, but could map to vars if preferred */
    color: var(--status-error);
    border: 1px solid #fecaca;
    padding: 12px; border-radius: 8px; font-size: 0.875rem;
    margin-bottom: 20px; text-align: center;
}

/* Mobile */
@media (max-width: 900px) {
    .split-container { flex-direction: column; overflow: auto; height: auto; }
    .branding-panel { padding: 4em 2em; text-align: center; border-right: none; border-bottom: 1px solid var(--border-medium); }
    .branding-panel::before { display: none; }
    .features { max-width: 320px; margin: 0 auto; }
    .features li { justify-content: flex-start; text-align: left; }
    .login-panel { padding: 4em 1.5em; background: var(--bg-card); }
    .card { text-align: center; }
    .card img.logo { display: inline-block; width: 50px; margin: 0 auto 1.5em auto; }
    .branding-logo { display: none; }
}


/* 1. Position Bottom-Right */
#langDropdown {
    position: absolute;
    top: 24px;    /* Use TOP instead of BOTTOM */
    right: 24px;
    z-index: 50;
}

/* Reset menu to open DOWNWARDS (Default behavior) */
#langDropdown .lang-menu {
    top: calc(100% + 10px); /* Push down below trigger */
    bottom: auto;           /* Remove bottom constraint */
    transform-origin: top right;
}

/* Reset animation to slide DOWN */
@keyframes menuScaleIn {
    0% { opacity: 0; transform: scale(0.95) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

#langDropdown .lang-menu.active {
    animation: menuScaleIn 0.2s ease-out forwards;
}