/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --text-primary: #f0eef6;
    --text-secondary: rgba(240, 238, 246, 0.6);
    --text-muted: rgba(240, 238, 246, 0.35);
    --accent-primary: #8b5cf6;
    --accent-primary-rgb: 139, 92, 246;
    --accent-secondary: #ec4899;
    --accent-green: #34d399;
    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== Background ===== */
.auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -180px;
    right: -100px;
    animation: float 12s ease-in-out infinite alternate;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -150px;
    left: -80px;
    animation: float 15s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(25px, -25px) scale(1.05);
    }

    100% {
        transform: translate(-15px, 15px) scale(0.95);
    }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ===== Auth Container ===== */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    animation: auth-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes auth-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Logo ===== */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Tabs ===== */
.auth-tabs {
    display: flex;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color var(--transition-fast);
}

.auth-tab.active {
    color: var(--text-primary);
}

.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: transform var(--transition-smooth);
    z-index: 1;
}

.tab-indicator.right {
    transform: translateX(100%);
}

/* ===== Form ===== */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: form-in 0.35s ease both;
}

.auth-form.active {
    display: flex;
}

@keyframes form-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.input-wrapper input:focus {
    border-color: rgba(var(--accent-primary-rgb), 0.5);
    background: rgba(255, 255, 255, 0.06);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input[type="date"] {
    color-scheme: dark;
}

.toggle-pass {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.toggle-pass:hover {
    opacity: 1;
}

/* ===== Avatar Upload ===== */
.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.avatar-preview {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px dashed var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--transition-base);
    background: rgba(255, 255, 255, 0.03);
}

.avatar-preview:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.05);
}

.avatar-preview.has-image {
    border-style: solid;
    border-color: var(--accent-primary);
}

.avatar-placeholder {
    font-size: 2rem;
    opacity: 0.5;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Button ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(var(--accent-primary-rgb), 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    padding: 13px 24px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Auth Switch Link ===== */
.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ===== Toast ===== */
.auth-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all 0.35s ease;
    z-index: 100;
    white-space: nowrap;
}

.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.auth-toast.error {
    border-left: 3px solid #ef4444;
}

.auth-toast.success {
    border-left: 3px solid var(--accent-green);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-logo {
        font-size: 1.3rem;
    }
}