@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    min-height: 100vh;
    background: var(--bg-deep);
    color: var(--text);
    overflow-x: hidden;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
}

.auth-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-mesh .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    animation: authDrift 18s ease-in-out infinite;
}

.auth-mesh .orb:nth-child(1) {
    width: 480px; height: 480px;
    background: var(--mesh-1);
    top: -15%; left: -10%;
}

.auth-mesh .orb:nth-child(2) {
    width: 400px; height: 400px;
    background: var(--mesh-2);
    bottom: -15%; right: -10%;
    animation-delay: -6s;
}

.auth-mesh .orb:nth-child(3) {
    width: 280px; height: 280px;
    background: var(--mesh-3);
    top: 45%; left: 50%;
    animation-delay: -12s;
}

@keyframes authDrift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(24px, -16px); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: var(--bg-glass);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow), 0 0 80px rgba(0, 229, 255, 0.06);
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px var(--primary-glow);
}

.auth-card h1 {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-sub {
    text-align: center;
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 32px;
    line-height: 1.5;
}

.auth-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.auth-feat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-2);
}

.auth-feat i {
    color: var(--primary);
    font-size: 13px;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.03em;
}

.input-group input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.strength-bar .bar {
    height: 3px;
    flex: 1;
    background: var(--border);
    border-radius: 2px;
    transition: background 0.3s;
}

.strength-bar .bar.weak { background: var(--danger); }
.strength-bar .bar.medium { background: #F59E0B; }
.strength-bar .bar.strong { background: var(--success); }

.auth-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    transition: filter 0.2s, transform 0.15s;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.auth-button:hover { filter: brightness(1.08); }
.auth-button:active { transform: scale(0.98); }

.button-text { transition: opacity 0.3s; }

.button-loader {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.loader-dot {
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: loaderBounce 1s infinite ease-in-out;
}

.loader-dot:nth-child(2) { animation-delay: 0.15s; }
.loader-dot:nth-child(3) { animation-delay: 0.3s; }

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

.auth-button.loading .button-text { opacity: 0; }
.auth-button.loading .button-loader { opacity: 1; }

.auth-footer {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-2);
    text-align: center;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

.theme-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    color: var(--text-2);
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    transition: transform 0.2s, color 0.2s;
    box-shadow: var(--shadow);
}

.theme-fab:hover {
    transform: scale(1.1);
    color: var(--primary);
}

@media (max-width: 768px) {
    .auth-page { padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    .auth-card { padding: 28px 20px; border-radius: 20px; width: 100%; max-width: 400px; }
    .auth-card input, .auth-card button { font-size: 16px; min-height: 48px; }
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 16px; border-radius: 16px; }
    .auth-features { gap: 10px; flex-wrap: wrap; justify-content: center; }
    .auth-logo { width: 56px; height: 56px; font-size: 18px; }
}