:root {
    --bg-obsidian: #020617;
    --bg-midnight: #0f172a;
    --neon-blue: #00f0ff;
    --neon-purple: #6366f1;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --crystal-bg: rgba(15, 23, 42, 0.6);
    --crystal-border: rgba(255, 255, 255, 0.1);
    --error-color: #ef4444;
    --success-color: #10b981;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.mesh-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05), transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.05), transparent 40%);
    z-index: 0;
}

.ambient-glow1, .ambient-glow2 {
    position: absolute;
    width: 600px; height: 600px;
    filter: blur(150px);
    opacity: 0.1;
    border-radius: 50%;
    z-index: 1;
}

.ambient-glow1 { top: -200px; left: -200px; background: var(--neon-blue); }
.ambient-glow2 { bottom: -200px; right: -200px; background: var(--neon-purple); }

/* Crystal Card */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.crystal-card {
    background: var(--crystal-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--crystal-border);
    border-radius: 30px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Branding */
.brand-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.book-icon-container {
    width: 60px; height: 60px;
    margin: 0 auto 1rem;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.glowing-book {
    font-size: 1.8rem;
    color: var(--neon-blue);
    filter: drop-shadow(0 0 8px var(--neon-blue));
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-title span {
    color: var(--neon-blue);
    font-weight: 300;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--crystal-border);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--neon-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* Buttons */
.neon-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.neon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.social-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--crystal-border);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.social-btn img {
    width: 20px;
}

/* Auth Views */
.auth-view {
    display: none;
    animation: slideIn 0.4s ease-out;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Divider */
.divider-text {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    position: relative;
}

.divider-text::before, .divider-text::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--crystal-border);
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

/* Footer */
.action-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ghost-btn {
    background: none;
    border: none;
    color: var(--neon-blue);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    transition: opacity 0.3s;
}

.ghost-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Feedback */
.feedback-msg {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    min-height: 1.2rem;
}

.feedback-msg.error { color: var(--error-color); }
.feedback-msg.success { color: var(--success-color); }

.hidden { display: none !important; }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    .crystal-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    .book-icon-container {
        width: 50px;
        height: 50px;
    }
    
    .glowing-book {
        font-size: 1.4rem;
    }
}