/* CSS Variables */
:root {
    --black: #000000;
    --white: #FFFFFF;
    --bg-100: #0a0d14;
    --bg-200: #111827;
    --bg-300: #1f2937;
    --bg-400: #374151;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #f59e0b;
    --tertiary: #10b981;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-mixed: linear-gradient(135deg, #2563eb 0%, #f59e0b 100%);
    --text-100: #F9FAFB;
    --text-200: #E5E7EB;
    --text-300: #9CA3AF;
    --text-400: #6B7280;
    --border: rgba(255, 255, 255, 0.08);
    --glow: 0 0 40px rgba(37, 99, 235, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg-100: #FFFFFF;
    --bg-200: #F3F4F6;
    --bg-300: #E5E7EB;
    --text-100: #111827;
    --text-200: #1f2937;
    --text-300: #4b5563;
    --border: rgba(0, 0, 0, 0.08);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-100);
    color: var(--text-200);
    line-height: 1.6;
    overflow: hidden;
}

/* ========================================
   PAGE TRANSITION OVERLAY
   ======================================== */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.transition-circle {
    width: 0;
    height: 0;
    background: var(--gradient-mixed);
    border-radius: 50%;
    animation: circleExpand 0.8s var(--ease-out) forwards;
}

@keyframes circleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 300vmax;
        height: 300vmax;
        opacity: 0;
    }
}

/* ========================================
   BACKGROUND
   ======================================== */
.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.bg-gradient-1 {
    position: absolute;
    top: -30%;
    right: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    filter: blur(100px);
    animation: floatGradient 10s ease-in-out infinite;
}

.bg-gradient-2 {
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    filter: blur(100px);
    animation: floatGradient 10s ease-in-out infinite 3s;
}

@keyframes floatGradient {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Particles */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: floatParticle 15s infinite linear;
}

.particle:nth-child(even) {
    background: var(--secondary);
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    90% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.login-container {
    position: relative;
    z-index: 10;
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Left Side - Branding */
.login-branding {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s var(--ease-out) 0.3s forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.branding-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: var(--white);
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-100);
}

.logo-highlight {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.branding-title {
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 700;
    color: var(--text-100);
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.branding-title .highlight {
    background: linear-gradient(135deg, #2563eb, #7c3aed, #f59e0b);
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.branding-subtitle {
    font-size: 15px;
    color: var(--text-400);
    max-width: 380px;
    margin-bottom: 32px;
    line-height: 1.5;
}

.branding-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateX(5px);
}

.feature-item:nth-child(1) {
    animation: slideInLeft 0.6s var(--ease-out) 0.5s forwards;
}

.feature-item:nth-child(2) {
    animation: slideInLeft 0.6s var(--ease-out) 0.65s forwards;
}

.feature-item:nth-child(3) {
    animation: slideInLeft 0.6s var(--ease-out) 0.8s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.feature-item:nth-child(1) .feature-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.15));
    border-color: rgba(245, 158, 11, 0.3);
}

.feature-item:nth-child(1) .feature-icon svg {
    color: #f59e0b;
}

.feature-item:nth-child(2) .feature-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.15));
    border-color: rgba(37, 99, 235, 0.3);
}

.feature-item:nth-child(2) .feature-icon svg {
    color: #2563eb;
}

.feature-item:nth-child(3) .feature-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
    border-color: rgba(16, 185, 129, 0.3);
}

.feature-item:nth-child(3) .feature-icon svg {
    color: #10b981;
}

.feature-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-200);
}

/* Right Side - Form */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 100px rgba(37, 99, 235, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: cardAppear 0.7s var(--ease-out) 0.3s forwards;
    backdrop-filter: blur(20px);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-100);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-400);
}

/* Google Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

/* Apple Button */
.btn-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #000000;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-top: 12px;
}

.btn-apple:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    background: #1a1a1a;
}

[data-theme="light"] .btn-apple {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    font-size: 13px;
    color: var(--text-400);
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-200);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-400);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 44px;
    background: var(--bg-300);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-100);
    transition: all 0.3s var(--ease);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-400);
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-400);
}

.password-toggle:hover {
    color: var(--text-100);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-300);
}

.checkbox-wrapper input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.forgot-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--secondary);
}

/* Submit Button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.btn-submit svg {
    width: 18px;
    height: 18px;
}

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-400);
}

.register-link a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.register-link a:hover {
    color: var(--secondary);
}

/* Info Box */
.info-box {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-md);
    margin-top: 24px;
}

.info-box.visible {
    display: flex;
}

.info-box svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.info-box span {
    font-size: 13px;
    color: var(--text-200);
}

/* Back Link */
.back-link {
    position: fixed;
    top: 32px;
    left: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-100);
    text-decoration: none;
    z-index: 100;
    opacity: 0;
    transform: translateX(-30px);
    animation: backLinkSlide 0.6s var(--ease-out) 0.3s forwards;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

@keyframes backLinkSlide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-link:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
    transform: translateX(-5px);
}

.back-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* Light mode */
[data-theme="light"] .login-card {
    background: var(--white);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-google {
    background: var(--bg-200);
    border: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 1024px) {
    .login-branding {
        display: none;
    }

    .login-form-side {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 32px 20px;
        border-radius: 20px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .login-header p {
        font-size: 13px;
    }

    .btn-submit,
    .btn-google {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .login-form-side {
        padding: 16px;
    }

    .login-card {
        padding: 24px 16px;
    }

    .back-link {
        top: 16px;
        left: 16px;
        padding: 8px 16px;
        font-size: 12px;
    }

    .back-link svg {
        width: 16px;
        height: 16px;
    }
}