html, body.auth-layout {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100vw;
    overflow: hidden; /* body itself locked — auth-right scrolls internally */
}

body.auth-layout {
    display: flex;
    height: 100vh;         /* full viewport height */
    background-color: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text-main);
}

/* Custom scrollbar for auth panels */
.auth-right::-webkit-scrollbar { width: 4px; }
.auth-right::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.auth-right::-webkit-scrollbar-track { background: transparent; }

/* Left Side: Visual Atmosphere */
.auth-left {
    flex: 1.2;
    position: relative;
    background: radial-gradient(circle at 50% 50%, rgba(18,24,38,1) 0%, rgba(10,15,26,1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    overflow: hidden;
}

.auth-ambient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 1;
}

.sphere-1 { width: 40vw; height: 40vw; background: rgba(34, 197, 94, 0.15); top: 10%; left: 10%; }
.sphere-2 { width: 30vw; height: 30vw; background: rgba(22, 163, 74, 0.1); bottom: 10%; right: 10%; }

.auth-visual-content {
    position: relative;
    z-index: 10;
    text-align: left;
    max-width: 500px;
    width: 100%;
}

.auth-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
}
.auth-logo span { color: var(--accent-light-blue); }

.auth-visual-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #FFF 0%, #A0AABF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-visual-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.auth-floating-ui {
    margin-top: 4rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    display: inline-flex;
    gap: 1.5rem;
    align-items: center;
    transform: rotate(-2deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.auth-floating-ui .icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(34, 197, 94, 0.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-light-blue);
}

/* Right Side: Auth Forms */
.auth-right {
    flex: 1;
    display: flex;
    flex-direction: column;  /* stack content vertically */
    justify-content: flex-start;
    align-items: center;
    padding: 3rem 2rem;
    position: relative;
    z-index: 20;
    background: rgba(10,15,26,0.95);
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(30px);
    height: 100vh;           /* fill full viewport height */
    overflow-y: auto;        /* scroll INSIDE this panel */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 2rem 0;   /* breathing room top/bottom inside panel */
}

/* Domain grid scroll on small screens */
@media (max-width: 900px) {
    .domain-grid {
        max-height: 260px; /* enough for 4 cards */
        overflow-y: auto;
        padding-right: 0.5rem; /* space for scrollbar */
    }
    /* Ensure auth-right takes full height */
    .auth-right {
        height: auto; /* let content dictate */
    }
}

.auth-view {
    display: none;
    opacity: 0;
}

.auth-view.active {
    display: block;
    opacity: 1;
}

/* Form Styles */
.auth-header { margin-bottom: 2.5rem; }
.auth-header h2 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 0.5rem; }
.auth-header p { color: var(--text-muted); font-size: 0.95rem; }

.input-group { margin-bottom: 1.5rem; position: relative; }
.input-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 500; }
.auth-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1.1rem 1.2rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}
.auth-input:focus {
    background: rgba(255,255,255,0.05);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    border: none;
    padding: 1.2rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.2);
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(22, 163, 74, 0.4);
}

.auth-btn-outline {
    width: 100%;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}
.auth-btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--glass-hover-border);
}

.auth-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s;
    cursor: pointer;
}
.auth-link:hover { color: var(--text-main); }
.auth-link.accent { color: var(--accent-light-blue); }
.auth-link.accent:hover { color: var(--accent-blue); }

.auth-footer {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Signup Wizard Specific */
.domain-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.domain-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    padding: 1.5rem 1rem;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.domain-card:hover {
    background: rgba(255,255,255,0.05);
}
.domain-card.selected {
    border-color: var(--accent-blue);
    background: rgba(34, 197, 94, 0.1);
    box-shadow: inset 0 0 20px rgba(34, 197, 94, 0.1);
}
.domain-card i { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 0.5rem; display: block; transition: color 0.3s; }
.domain-card.selected i { color: var(--accent-light-blue); }
.domain-card span { font-size: 0.9rem; font-weight: 500; }

.goal-textarea {
    width: 100%;
    height: 160px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1.5rem;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    line-height: 1.6;
}
.goal-textarea:focus { border-color: rgba(22, 163, 74, 0.5); }

.step-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
}
.step-dot {
    height: 4px; flex: 1;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
.step-dot.active {
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
}

/* Responsive */
@media (max-width: 900px) {
    /* On mobile, unlock body scroll — page scrolls naturally */
    html, body.auth-layout {
        height: auto;
        min-height: 100vh;
        overflow-y: auto !important;
    }
    body.auth-layout { flex-direction: column; }
    .auth-left { flex: none; padding: 3rem 1.5rem; min-height: auto; align-items: flex-start; }
    .auth-visual-title { font-size: 2.5rem; }
    .auth-floating-ui { display: none; }
    .auth-right { 
        flex: none;
        height: auto;          /* don't lock to 100vh on mobile */
        overflow-y: visible;   /* let the page scroll, not the panel */
        padding: 2rem 1.5rem; 
        border-left: none; 
        border-top: 1px solid var(--glass-border); 
        align-items: flex-start; 
        width: 100%;
    }
    .auth-container { margin: 0 auto; padding: 1rem 0; }
    .domain-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; max-height: none; }
    .domain-card { padding: 1.2rem 0.8rem; }
}
