/* Login Page Specific Styles */

/* Provide fallbacks/mapping for variables expected by this page */
:root {
    /* Map to global palette from styles.css */
    --primary-color: var(--primary, #7c6cf5);
    --secondary-color: var(--accent, #f87cb3);
    --accent-color: var(--secondary, #5cc8d4);
    --text-color: var(--text-primary, #2d2440);
    --text-secondary: var(--text-secondary, #6b5f8a);
    --card-bg: var(--card-bg, #ffffff);
    --border-color: var(--gray-light, #e2e8f0);
    --bg-input: var(--bg-color, #fffbfe);
    --box-shadow-lg: var(--shadow-xl, 0 20px 40px rgba(0,0,0,0.13));
    --box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.10));
    --border-radius: var(--border-radius, 12px);
    --border-radius-lg: var(--border-radius-lg, 20px);

    /* Spacing + type scale fallbacks */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --font-size-sm: 0.9rem;
    --font-size-xl: 1.25rem;

    /* Animation timings */
    --animation-fast: 150ms;
    --animation-medium: 300ms;
    --animation-slow: 600ms;

    /* Decorative water accents */
    --water-light: rgba(124, 108, 245, 0.10);
    --water-medium: rgba(124, 108, 245, 0.18);
}

/* ===================================
   Atmospheric page background
   =================================== */

body {
    animation: fadeIn var(--animation-medium) ease-in forwards;
    background:
        radial-gradient(ellipse 900px 650px at 15% 40%, rgba(124, 108, 245, 0.09) 0%, transparent 70%),
        radial-gradient(ellipse 600px 500px at 88% 18%, rgba(248, 124, 179, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 500px 400px at 60% 85%, rgba(92, 200, 212, 0.07) 0%, transparent 60%),
        var(--bg-color);
}

[data-theme="dark"] body {
    background:
        radial-gradient(ellipse 900px 650px at 15% 40%, rgba(124, 108, 245, 0.22) 0%, transparent 70%),
        radial-gradient(ellipse 600px 500px at 88% 18%, rgba(248, 124, 179, 0.13) 0%, transparent 65%),
        radial-gradient(ellipse 400px 350px at 60% 85%, rgba(92, 200, 212, 0.10) 0%, transparent 60%),
        var(--bg-color);
}

/* Atmosphere container — fixed, behind everything */
.login-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* floating-brand and floating-controls are already position:fixed z-index:9999 */
.container { position: relative; z-index: 1; }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Keep logo a sane size */
.logo-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.rounded { border-radius: 50%; }

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-content .logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.header-content .logo-container a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-content .logo-container h1 {
    font-size: 1.5rem;
    margin: 0;
    margin-left: 0.75rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    color: var(--primary-color);
    text-decoration: none;
    margin-top: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--animation-medium) ease;
    position: relative;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--border-radius);
    background: var(--water-light);
}

.back-link::before {
    content: '←';
    font-weight: bold;
    margin-right: var(--spacing-1);
    transition: transform var(--animation-medium) ease;
}

.back-link:hover::before {
    transform: translateX(-2px);
}

.back-link:hover {
    color: var(--secondary-color);
    background: var(--water-medium);
    transform: translateX(-2px);
}

/* Dark mode toggle */
.dark-toggle {
    font-size: var(--font-size-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3);
    border-radius: 50%;
    background-color: var(--water-light);
    color: var(--text-color);
    transition: all var(--animation-medium) ease;
    border: 2px solid transparent;
}

.dark-toggle:hover {
    background-color: var(--water-medium);
    transform: translateY(-2px) scale(1.05);
    border-color: var(--primary-color);
}

[data-theme="dark"] .dark-toggle {
    background-color: var(--water-light);
}

[data-theme="dark"] .dark-toggle:hover {
    background-color: var(--water-medium);
}

.auth-container {
    background: var(--modal-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius-xl, 30px);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 520px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    animation: slideUp var(--animation-slow) cubic-bezier(0.19, 1, 0.22, 1) forwards;
    transform: translateY(20px);
    opacity: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Top bar removed */
.auth-container::before { display: none; }

.auth-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: radial-gradient(ellipse at center bottom, var(--water-light), transparent);
    opacity: 0.6;
    z-index: 0;
}

/* Dark mode: make the card clearly distinct from the background */
[data-theme="dark"] .auth-container {
    background: rgba(30, 24, 52, 0.95);
    border: 1px solid rgba(124, 108, 245, 0.35);
    box-shadow:
        0 0 0 1px rgba(124, 108, 245, 0.15),
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(124, 108, 245, 0.08);
}

/* Subtle lift on hover */
.auth-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 60px rgba(124, 108, 245, 0.2);
}

[data-theme="dark"] .auth-container:hover {
    box-shadow:
        0 0 0 1px rgba(124, 108, 245, 0.25),
        0 36px 90px rgba(0, 0, 0, 0.65),
        0 0 100px rgba(124, 108, 245, 0.12);
}

/* Water ripple used by JS */
.water-ripple {
    position: absolute;
    width: 12px;
    height: 12px;
    left: 0;
    top: 0;
    background: radial-gradient(circle at center, rgba(124,108,245,0.35) 0%, rgba(124,108,245,0.2) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
    animation: ripple 2s ease-out forwards;
    z-index: 0;
}

@keyframes ripple {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.8); }
    60% { opacity: 0.35; transform: translate(-50%, -50%) scale(8); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(10); }
}

/* Themed modal tweaks to match landing (pill inputs/buttons) */
.modal-container .modal-input {
    border-radius: 999px;
    padding: 0.9rem 1.15rem;
}

.modal-container .modal-btn {
    border-radius: 999px;
    height: 48px;
    padding: 0.9rem 1.25rem;
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-weight: 700;
}

.modal-container .modal-btn.primary {
    background: var(--gradient-primary);
    box-shadow: 0 10px 30px rgba(124,108,245,0.3);
}

.modal-container .modal-btn.primary:hover {
    box-shadow: 0 15px 35px rgba(124,108,245,0.35);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .tabs {
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    position: relative;
    transition: all var(--animation-medium) cubic-bezier(0.19, 1, 0.22, 1);
    color: var(--text-color);
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--animation-medium) ease;
}

.tab-btn:hover {
    opacity: 1;
}

.tab-btn:hover::after {
    transform: scaleX(0.5);
}

.tab-btn.active {
    opacity: 1;
    font-weight: 600;
    color: var(--primary-color);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

/* Tab Content */
.tab-content {
    display: none;
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--animation-medium) ease;
}

.tab-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.tab-content h2::after { display: none; }

/* Enhanced Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    transition: color var(--animation-fast) ease;
    color: var(--text-color);
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all var(--animation-medium) cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-input);
    color: var(--text-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

[data-theme="dark"] .form-group input {
    border: 1.5px solid rgba(124, 108, 245, 0.28);
    background-color: rgba(255, 255, 255, 0.06);
    color: #ede9f8;
    box-shadow: none;
}

[data-theme="dark"] .form-group input::placeholder {
    color: rgba(180, 165, 220, 0.45);
}

/* Password toggle — positioned inside .input-wrapper */
.input-wrapper {
    position: relative;
    display: block;
}

.input-wrapper input[type="password"] {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--animation-fast) ease;
    padding: 0;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    transform: translateY(-2px);
}

/* Remove the problematic label selector since labels come before inputs */

.form-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
}

[data-theme="dark"] .form-text {
    opacity: 0.6;
}

.form-text a {
    color: var(--secondary-color);
    text-decoration: none;
    position: relative;
    transition: all var(--animation-fast) ease;
}

.form-text a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transition: transform var(--animation-medium) ease;
}

.form-text a:hover {
    color: var(--primary-color);
}

.form-text a:hover::after {
    transform: scaleX(1);
}

/* Anonymous Section */
.anonymous-section {
    margin-top: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.divider {
    position: relative;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
}

[data-theme="dark"] .divider::before {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.divider span {
    position: relative;
    background-color: var(--card-bg);
    padding: 0 1rem;
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.9rem;
}

.anonymous-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.6;
    line-height: 1.4;
}

/* Button Styles (overriding some global styles) */
.btn {
    width: 100%;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    height: 52px;
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-weight: 700;
    letter-spacing: 0.2px;
    border-radius: 999px;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform var(--animation-fast) ease-out, opacity var(--animation-fast) ease-out;
}

.btn:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.btn.primary {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    box-shadow: 0 10px 30px rgba(124,108,245,0.3);
    transform: translateY(0);
    transition: all var(--animation-medium) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(124,108,245,0.35);
}

/* Shine sweep like landing buttons */
.btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 0.6s ease;
}

.btn.primary:hover::before { left: 100%; }

/* Secondary button styled like header secondary */
.btn.secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--gray-light, #e2e8f0);
}

.btn.secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary, #7c6cf5);
    color: var(--primary, #7c6cf5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#anonymous-login {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--gray-light, #e2e8f0);
    box-shadow: none;
    transition: all var(--animation-medium) ease;
}

[data-theme="dark"] #anonymous-login {
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#anonymous-login:hover {
    background: var(--bg-secondary);
    border-color: var(--primary, #7c6cf5);
    color: var(--primary, #7c6cf5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dark-toggle {
        font-size: 1rem;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 1rem 0;
    }
    
    .auth-container {
        padding: 1.25rem;
        border-radius: 20px;
    }
    
    .tabs {
        margin-bottom: 1.5rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        flex: 1;
        text-align: center;
    }
    
    .tab-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input {
        padding: 0.7rem 0.85rem;
    }
    
    .btn {
        height: 48px;
        padding: 0.85rem 1rem;
    }
    
    header {
        margin-bottom: 1rem;
    }
    
    .header-content .logo-container h1 {
        font-size: 1.25rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .tab-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .anonymous-section {
        margin-top: 1.5rem;
    }
    
    .divider {
        margin: 1rem 0;
    }
}

/* ===================================
   Mobile Navbar Fixes
   =================================== */

/* Ensure floating navbar elements always stay visible on mobile */
@media (max-width: 768px) {
    .floating-brand,
    .floating-controls {
        position: fixed !important;
        z-index: 9999 !important;
        transform: none !important;
        -webkit-transform: none !important;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .floating-brand {
        top: 14px !important;
        left: 14px !important;
    }
    
    .floating-controls {
        top: 14px !important;
        right: 14px !important;
        left: auto !important;
    }
} 