/* Global Reset & Base Styles */
:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.4);
    /* More transparent */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-orange: #fb923c;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.03);
    --font-heading: 'Outfit', sans-serif;
    --font-base: 'Inter', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Hide brand logo specifically for 1024px screens */
@media only screen and (width: 1024px) {
    .brand-logo {
        display: none !important;
    }
}

/* Split Layout */
.split-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Left Side */
.left-panel {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    border-right: 1px solid var(--border-color);
    background: radial-gradient(circle at 0% 0%, rgba(251, 146, 60, 0.03), transparent 40%);
    position: relative;
    box-sizing: border-box;
}

.brand-logo {
    position: absolute;
    top: 2.5rem;
    left: 2.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.brand-header {
    margin-bottom: 2.5rem;
    text-align: center;
    width: 100%;
    max-width: 380px;
}

.welcome-text h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.auth-selection {
    width: 100%;
    max-width: 320px;
    /* Tighter width for buttons */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Minimal Social Buttons */
.btn-social-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box;
}

.btn-social-select:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 1.5rem 0;
    opacity: 0.6;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.separator span {
    padding: 0 0.75rem;
}

/* Auth Toggle Area */
.auth-toggle-area {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
}

.toggle-prompt {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-toggle-mode {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-toggle-mode:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Right Side - Form Display */
.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

/* Background Beam Effect */
.beam-effect {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at 50% 50%, rgba(251, 146, 60, 0.06), transparent 50%);
    top: -25%;
    left: -25%;
    pointer-events: none;
    opacity: 0.6;
    filter: blur(60px);
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    z-index: 10;
}

/* Premium Minimal Modal Card */
.form-container .modal-card {
    display: block !important;
    position: static;
    transform: none;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 2.5rem;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Override Header */
.modal-header {
    text-align: left;
    /* Align left for cleaner look */
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Helper to hide/show forms based on state */
.auth-form-wrapper {
    display: none !important;
}

.auth-form-wrapper.active {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out;
}

/* Form Elements */
.auth-form {
    gap: 0.5rem;
}

.form-group label {
    display: none;
    /* Minimal: Hide labels, rely on placeholders or floating labels? Stick to simple placeholders for now as per minimal prompt */
}

/* Sleek Inputs */
.modal-card .input-wrapper {
    margin-bottom: 0.5rem;
}

.input-field-area {
    position: relative;
    height: 48px;
    width: 100%;
}

.modal-card .auth-form input {
    width: 100%;
    height: 100%;
    background: var(--input-bg);
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px var(--border-color);
    border-radius: 10px;
    padding: 0 42px 0 42px !important;
    /* Fixed padding for icons on both sides */
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modal-card .auth-form input:focus {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.02);
    border-color: transparent;
    outline: none;
}

/* Icon Alignment - Relative to input-field-area */
.modal-card .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 5;
    margin: 0;
}

.modal-card .password-toggle {
    position: absolute;
    right: 10px;
    /* Adjusted position */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 2px;
    /* Minimal padding for maximum icon size */
    transition: color 0.2s, transform 0.2s;
    z-index: 5;
}

.modal-card .password-toggle svg,
div.input-field-area button.password-toggle svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
}

.modal-card .password-toggle:hover {
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    /* Subtle grow on hover */
}

/* Primary Button */
.btn-primary-block {
    background: #fff;
    /* White button for high contrast premium feel */
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s, background 0.2s;
    height: 48px;
}

.btn-primary-block:hover {
    background: #f2f2f2;
    transform: translateY(-1px);
}

/* Links */
.form-actions {
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
}

.forgot-password {
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.8;
}

.forgot-password:hover {
    color: #fff;
    text-decoration: none;
    opacity: 1;
}

/* Footer in Card */
.modal-footer {
    display: none;
    /* Hide footer in card for minimal look, or move it? Let's hide it to be minimal */
}

/* Mobile Refactor for < 1024px */
@media (max-width: 1023px) {

    html,
    body {
        overflow: hidden !important;
        /* Remove scrollbars */
        height: 100% !important;
        margin: 0;
        padding: 0;
    }

    .brand-logo {
        display: none !important;
    }

    .split-container {
        flex-direction: column;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    .left-panel {
        display: none !important;
        /* Hide the entire left panel on mobile */
    }

    .right-panel {
        width: 100%;
        height: 100%;
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        /* Use column to ensure vertical stack if needed, but still center */
        align-items: center;
        /* Center horizontally */
        justify-content: center;
        /* Center vertically */
        background: #000;
        position: relative;
        overflow: hidden;
    }

    .form-container {
        width: 100%;
        max-width: 540px;
        /* Tablet/Large Mobile width */
        margin: 0 auto;
        /* Redundant centering for safety */
        padding: 1.5rem;
        z-index: 10;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
    }

    /* Normal mobile phones < 500px */
    @media (max-width: 500px) {
        .form-container {
            max-width: 100%;
            padding: 1rem;
        }

        .form-container .modal-card {
            padding: 2rem 1.25rem;
        }

        .modal-header h2 {
            font-size: 1.5rem;
        }
    }

    /* Extremely small phones < 400px */
    @media (max-width: 400px) {
        .form-container {
            padding: 1rem 0.25rem;
            max-width: 310px;
            /* Even smaller width */
        }

        .form-container .modal-card {
            padding: 1rem 0.75rem;
            width: auto;
            min-width: 240px;
            /* Reduced min-width */
        }

        .modal-header {
            margin-bottom: 0.5rem;
        }

        .modal-header h2 {
            font-size: 1.1rem;
            /* Smaller font */
        }

        .modal-header p {
            font-size: 0.7rem;
        }

        .btn-social-select {
            font-size: 0.7rem;
            padding: 6px;
            gap: 4px;
        }

        .modal-card .auth-form input {
            height: 36px !important;
            font-size: 0.75rem;
        }

        .input-field-area {
            height: 36px;
        }

        .btn-primary-block {
            height: 38px;
            font-size: 0.8rem;
            margin-top: 0.4rem;
        }

        .mobile-only-auth {
            margin-top: 0.5rem;
        }

        .separator {
            margin: 0.75rem 0;
        }

        .mobile-toggle-footer {
            margin-top: 0.5rem;
            padding-top: 0.5rem;
        }

        .mobile-toggle-footer p {
            font-size: 0.75rem;
        }
    }

    .form-container .modal-card {
        padding: 2.5rem 2rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Mobile Only Area Styling */
    .mobile-only-auth {
        display: block !important;
        margin-top: 1.5rem;
    }

    .mobile-social-btns {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .mobile-toggle-footer {
        text-align: center;
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .mobile-toggle-footer p {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .mobile-toggle-btn {
        background: none;
        border: none;
        color: var(--accent-orange);
        font-weight: 600;
        cursor: pointer;
        padding: 0;
        margin-left: 4px;
        font-size: 0.9rem;
    }

    /* Primary button should be on top of social now */
    .btn-primary-block {
        margin-bottom: 0.5rem;
    }

    .modal-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }
}

/* Base hidden state for mobile elements */
.mobile-only-auth {
    display: none;
}