/* ── Reset & Base ─────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b0f1a;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-glow: rgba(129, 140, 248, 0.25);
    --success: #34d399;
    --error: #f87171;
    --radius: 14px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Floating Orbs ───────────────────────────────── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    animation: float 20s ease-in-out infinite alternate;
}
.orb-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, #818cf8, transparent 70%);
    top: -10%; left: -8%;
}
.orb-2 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #c084fc, transparent 70%);
    bottom: -5%; right: -5%;
    animation-delay: -7s;
}
.orb-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, #38bdf8, transparent 70%);
    top: 40%; right: 15%;
    animation-delay: -14s;
}
@keyframes float {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, -20px) scale(1.08); }
    100% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ── Layout ──────────────────────────────────────── */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* ── Brand ───────────────────────────────────────── */
.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 2rem;
    animation: fadeDown 0.6s ease-out;
}
.brand-icon {
    display: flex;
}
.brand h1 {
    font-size: 1.55rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* ── Auth Card ───────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    animation: fadeUp 0.5s ease-out;
    position: relative;
}

/* ── Tabs ────────────────────────────────────────── */
.tabs {
    display: flex;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.75rem;
}
.tab {
    flex: 1;
    padding: 0.6rem 0;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}
.tab.active {
    color: #fff;
}
.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(129, 140, 248, 0.18);
    border-radius: 8px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.tabs[data-active="register"] .tab-indicator {
    transform: translateX(100%);
}

/* ── Forms ───────────────────────────────────────── */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 1.15rem;
}
.auth-form.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.form-group input {
    width: 100%;
    padding: 0.72rem 0.9rem;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Button ──────────────────────────────────────── */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.35rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Spinner ─────────────────────────────────────── */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.hidden { display: none !important; }

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

/* ── Response Message ────────────────────────────── */
.response-message {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: 10px;
    animation: fadeIn 0.3s ease-out;
}
.response-message.success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: var(--success);
}
.response-message.error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: var(--error);
}

/* ── Footer ──────────────────────────────────────── */
.footer-text {
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.6;
    animation: fadeDown 0.6s ease-out 0.2s both;
}

/* ── Animations ──────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
}
