/* auth.css - Purple Split-Card Design with Logo & Copyright Support */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --purple-primary: #8b5cf6;
    --purple-dark: #6d28d9;
    --purple-light: #c4b5fd;
    --purple-btn-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --card-radius: 36px;
    
    /* Dark Mode Defaults */
    --bg-page: radial-gradient(circle at top left, #2e1065 0%, #1e1147 50%, #0f0728 100%);
    --card-bg-right: #170f2f;
    --card-border: 1px solid rgba(167, 139, 250, 0.2);
    --card-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 10px 25px rgba(0, 0, 0, 0.4);
    --left-panel-gradient: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    --text-title: #ddd6fe;
    --text-label: #c4b5fd;
    --input-line: #7c3aed;
    --input-line-focus: #a78bfa;
    --input-text: #f5f3ff;
    --input-placeholder: #a78bfa;
    --text-link: #c4b5fd;
    --back-btn-bg: rgba(255, 255, 255, 0.15);
    --back-btn-color: #ffffff;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-page: radial-gradient(circle at top left, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%);
    --card-bg-right: #ffffff;
    --card-border: 1px solid rgba(124, 58, 237, 0.15);
    --card-shadow: 0 30px 70px rgba(124, 58, 237, 0.18), 0 10px 25px rgba(124, 58, 237, 0.08);
    --left-panel-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --text-title: #6d28d9;
    --text-label: #6d28d9;
    --input-line: #a78bfa;
    --input-line-focus: #6d28d9;
    --input-text: #4c1d95;
    --input-placeholder: #c4b5fd;
    --text-link: #6d28d9;
    --back-btn-bg: rgba(255, 255, 255, 0.2);
    --back-btn-color: #ffffff;
}

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

html {
    background: var(--bg-page);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: #334155;
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* Background Ambient Glows */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(109, 40, 217, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Floating Theme Toggle Switcher */
.theme-toggle-floating {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
}

body.light-mode .theme-toggle-btn {
    background: rgba(109, 40, 217, 0.1);
    border-color: rgba(109, 40, 217, 0.2);
    color: #6d28d9;
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.15);
}

.theme-toggle-btn:hover {
    transform: scale(1.08) rotate(15deg);
}

/* Outer Container */
.auth-outer-container {
    width: 100%;
    max-width: 980px;
    margin: auto;
    position: relative;
    z-index: 10;
}

/* Main Split Card */
.auth-split-card {
    background: var(--card-bg-right);
    border: var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    overflow: hidden;
    min-height: 600px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Left Purple Panel */
.auth-card-left {
    background: var(--left-panel-gradient);
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    position: relative;
}

/* Logo Header inside Left Panel */
.auth-logo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 16px;
}

.back-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--back-btn-bg);
    color: var(--back-btn-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-icon-btn:hover {
    transform: translateX(-3px);
    background: rgba(255, 255, 255, 0.3);
}

.auth-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-logo-img {
    max-height: 46px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.logo-fallback-text {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.left-illustration-container {
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-svg-graphic {
    width: 100%;
    height: auto;
    max-height: 280px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.left-footer-text {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    max-width: 340px;
}

/* Right White/Dark Panel */
.auth-card-right {
    background: var(--card-bg-right);
    padding: 0 44px 36px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: background 0.3s ease;
}

/* Top "Welcome back" / "Get Started" Pill Header */
.auth-pill-header-container {
    display: flex;
    justify-content: flex-start;
    margin-left: -44px;
}

.auth-pill-header {
    background: var(--purple-btn-gradient);
    color: #ffffff;
    padding: 12px 36px;
    border-radius: 0 0 24px 0;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

/* Title */
.auth-title-purple {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-title);
    text-align: center;
    margin-top: 32px;
    margin-bottom: 28px;
    transition: color 0.3s ease;
}

/* Form Styles */
.form-purple-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-underline {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-label-underline {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-label);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.form-input-underline {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--input-line);
    padding: 10px 16px;
    font-size: 15px;
    color: var(--input-text);
    font-family: inherit;
    background: rgba(139, 92, 246, 0.06);
    border-radius: 8px 8px 0 0;
    outline: none;
    transition: border-color 0.2s ease, color 0.3s ease, background 0.2s ease;
}

body.light-mode .form-input-underline {
    background: rgba(124, 58, 237, 0.04);
}

.form-input-underline::placeholder {
    color: var(--input-placeholder);
    font-weight: 300;
    opacity: 0.7;
}

.form-input-underline:focus {
    border-bottom-color: var(--input-line-focus);
    background: rgba(139, 92, 246, 0.12);
}

/* Chrome Autofill fix for input text padding and background */
.form-input-underline:-webkit-autofill,
.form-input-underline:-webkit-autofill:hover, 
.form-input-underline:-webkit-autofill:focus, 
.form-input-underline:-webkit-autofill:active {
    -webkit-text-fill-color: var(--input-text) !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(124, 58, 237, 0.1) inset !important;
    transition: background-color 5000s ease-in-out 0s;
    border-radius: 8px 8px 0 0;
}

/* Action Button */
.btn-purple-pill {
    background: var(--purple-btn-gradient);
    color: #ffffff;
    border: none;
    padding: 13px 48px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35);
    transition: all 0.2s ease;
    align-self: center;
    margin-top: 12px;
    min-width: 150px;
    text-align: center;
}

.btn-purple-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.45);
    filter: brightness(1.05);
}

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

/* Navigation Links */
.auth-secondary-link {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-link);
    text-decoration: none;
    text-align: center;
    display: block;
    margin-top: 16px;
    transition: opacity 0.2s ease, color 0.3s ease;
}

.auth-secondary-link:hover {
    opacity: 0.8;
}

.auth-forgot-link {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-link);
    text-decoration: underline;
    text-align: center;
    display: block;
    margin-top: 24px;
    margin-bottom: 4px;
    transition: opacity 0.2s ease, color 0.3s ease;
}

.auth-forgot-link:hover {
    opacity: 0.8;
}

/* Copyright Footer */
.auth-copyright-text {
    font-size: 11px;
    color: var(--text-link);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-top: 16px;
}

/* Alert Styling */
.alert {
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

body.light-mode .alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

body.light-mode .alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

/* Responsive Layout */
@media (max-width: 868px) {
    .auth-split-card {
        grid-template-columns: 1fr;
        border-radius: 28px;
    }

    .auth-card-left {
        padding: 28px 24px;
    }

    .left-illustration-container {
        max-width: 220px;
    }

    .auth-card-right {
        padding: 0 28px 32px 28px;
    }

    .auth-pill-header-container {
        margin-left: -28px;
    }

    .auth-pill-header {
        padding: 10px 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .auth-split-card {
        border-radius: 24px;
    }

    .auth-card-right {
        padding: 0 20px 24px 20px;
    }

    .auth-pill-header-container {
        margin-left: -20px;
    }

    .btn-purple-pill {
        width: 100%;
    }

    .theme-toggle-floating {
        top: 16px;
        right: 16px;
    }
}