/* V3 Styles - Split & Responsive */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-color);
    color: #fff;
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll */
}

/* Layout Wrapper */
.main-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Section */
.split-sidebar {
    position: relative;
    background-color: var(--sidebar-color);
    width: 0;
    /* Default hidden/collapsed for centered mode */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 2;
}

.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.sidebar-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
    color: #fff;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.5s;
}

.site-logo-sidebar img {
    max-width: 180px;
    height: auto;
    margin-bottom: 2rem;
}

.site-logo-sidebar h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.sidebar-text h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.sidebar-text p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Form Section */
.form-section {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* Enable Scroll explicitly here */
    padding: 2rem;
}

.background-animation {
    position: fixed;
    /* Fixed relative to viewport to stay put */
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-color);
    filter: blur(90px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out;
}

.c1 {
    width: 300px;
    height: 300px;
    top: -50px;
    right: -50px;
}

.c2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
    background: #3b82f6;
    animation-delay: 2s;
}

/* Auth Card */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* If Split Mode is Active */
body.layout-split .split-sidebar {
    width: 50%;
}

body.layout-split .site-logo-mobile {
    display: none;
    /* Hide mobile logo on desktop split */
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 30px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Forms */
.auth-form {
    display: none;
    animation: fadeScale 0.3s ease-out;
}

.auth-form.active {
    display: block;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #fff;
}

.subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 40px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.actions {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.actions a {
    color: var(--primary-color);
    text-decoration: none;
}

.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    gap: 10px;
    transition: transform 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(110%);
}

.btn-google {
    background: #fff;
    color: #333;
    margin-top: 1rem;
    text-decoration: none;
}

.btn-google:hover {
    background: #f8fafc;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.3);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 10px;
    font-size: 0.8rem;
}

.footer-text {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

/* RESPONSIVE DESIGN & MOBILE STACKING */
@media (max-width: 900px) {
    .main-wrapper {
        flex-direction: column;
        /* Stack top-down */
        overflow-y: auto;
        /* Allow wrapper to scroll on mobile */
    }

    /* Fixed sidebar at top - Acts as Header */
    body.layout-split .split-sidebar {
        width: 100%;
        height: auto;
        min-height: 220px;
        /* Taller to comfortably fit logo */
        flex-shrink: 0;
        padding: 2rem 1rem;
        border-bottom-left-radius: 30px;
        /* Premium curve */
        border-bottom-right-radius: 30px;
        box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    }

    /* Ensure the logo inside the sidebar IS visible and styled */
    .site-logo-sidebar img {
        max-width: 140px;
        margin-bottom: 0.5rem;
        filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    }

    .site-logo-sidebar h1 {
        font-size: 1.8rem;
        margin: 0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    /* Hide the text description on mobile to keep header clean */
    .sidebar-text {
        display: none;
    }

    /* Hide the DUPLICATE logo inside the card */
    .site-logo-mobile {
        display: none !important;
    }

    .form-section {
        flex: 1;
        padding: 0 1.5rem 3rem 1.5rem;
        /* Padding adjustment */
        align-items: flex-start;
        /* Ensure it starts at top */
        margin-top: -40px;
        /* Overlap effect for premium feel */
    }

    .auth-card {
        box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
        background: rgba(255, 255, 255, 0.1);
        /* Slightly more visible on mobile overlapping */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        padding: 2rem 1.5rem;
    }

    /* Make text inputs easier to tap */
    .input {
        padding: 1rem;
    }
}

@media (max-height: 700px) and (min-width: 901px) {

    /* Short desktop screens: ensure sidebar scroll logic if needed */
    .form-section {
        overflow-y: auto;
        display: block;
        text-align: center;
    }

    .auth-card {
        margin: 2rem auto;
    }
}