:root {
    --primary: #ffffff;
    --primary-rgb: 255, 255, 255;
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.1);
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: 32px;
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.4);
    --error: #ff453a;
    --success: #32d74b;
    --input-bg: rgba(255, 255, 255, 0.03);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    line-height: 1.6;
    padding: 40px 0 160px 0; /* Safe padding for bottom navigation bar */
}

/* --- Premium Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-background {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% -20%, #1a1a1a 0%, #0a0a0a 100%);
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
}

/* --- Auth Container --- */
.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    perspective: 1000px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 60px 40px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.4);
    animation: cardEntrance 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) rotateX(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* --- Tabs --- */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- Avatar Upload --- */
.avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.avatar-upload-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-upload-wrapper:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
}

.avatar-label {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

.avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.camera-icon {
    width: 28px;
    height: 28px;
    color: var(--text-main);
    opacity: 0.6;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.upload-hint {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    z-index: 2;
}

.avatar-label::after {
    content: 'Change';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-label:hover::after {
    opacity: 1;
}


/* --- Form Controls --- */
.inputs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: var(--text-dim);
    transition: color 0.3s;
}

input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 16px 14px 48px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

input:focus + .input-icon {
    color: #fff;
}

.focus-indicator {
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0;
}

input:focus ~ .focus-indicator {
    width: 30px;
    opacity: 1;
}

.toggle-password {
    position: absolute;
    right: 16px;
    width: 20px;
    height: 20px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #fff;
}

/* --- Button --- */
.primary-button {
    width: 100%;
    position: relative;
    background: #fff;
    border: none;
    border-radius: 18px;
    padding: 18px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.button-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.2px;
}

.primary-button:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1);
}

.primary-button:active {
    transform: translateY(0) scale(0.98);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease-out;
}

.primary-button:hover .button-glow {
    transform: translate(-50%, -50%) scale(1);
}

/* --- Form Actions & Secondary Button --- */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.auth-divider span {
    padding: 0 12px;
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secondary-button {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.secondary-button:active {
    transform: translateY(0);
}

/* --- Loader --- */
.loader {
    display: none;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- Footer --- */
.auth-footer {
    margin-top: 32px;
    text-align: center;
}

.footer-text {
    font-size: 14px;
    color: var(--text-dim);
}

.link-button {
    background: none;
    border: none;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.link-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.status-banner {
    margin-top: 24px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.status-banner.error {
    background: rgba(255, 69, 58, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 69, 58, 0.2);
}

.status-banner.success {
    background: rgba(50, 215, 75, 0.1);
    color: var(--success);
    border: 1px solid rgba(50, 215, 75, 0.2);
}


/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 40px 24px;
        border-radius: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
    }
    
    .auth-container {
        padding: 0;
    }
}