:root {
    --bg-primary: #1a1b26;
    --bg-secondary: #16161e;
    --bg-tertiary: #24283b;
    --bg-hover: #2d3149;
    --border-color: #292e42;
    --text-primary: #c0caf5;
    --text-secondary: #9aa5ce;
    --text-muted: #565f89;
    --accent-primary: #7aa2f7;
    --accent-secondary: #bb9af7;
    --accent-light: rgba(122, 162, 247, 0.1);
    --error: #f7768e;
    --success: #9ece6a;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    animation: pageLoad 0.5s ease-out;
}

@keyframes pageLoad {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

@media (max-width: 968px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }
}

/* Left Side - Branding */
.auth-left {
    background: linear-gradient(135deg, #24283b 0%, #1a1b26 100%);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(122, 162, 247, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(187, 154, 247, 0.12) 0%, transparent 60%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.auth-branding {
    max-width: 500px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

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

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 48px;
    color: var(--accent-primary);
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(122, 162, 247, 0.4));
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(122, 162, 247, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px rgba(122, 162, 247, 0.6));
    }
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

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

.brand-tagline {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.brand-description {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 16px;
    animation: fadeInUp 0.6s ease-out backwards;
    transition: transform 0.3s ease, color 0.3s ease;
}

.feature-item:nth-child(1) { animation-delay: 0.7s; }
.feature-item:nth-child(2) { animation-delay: 0.8s; }
.feature-item:nth-child(3) { animation-delay: 0.9s; }
.feature-item:nth-child(4) { animation-delay: 1.0s; }

.feature-item:hover {
    transform: translateX(5px);
    color: var(--text-primary);
}

.feature-item svg {
    color: var(--accent-primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.feature-item:hover svg {
    transform: scale(1.2);
}

/* Right Side - Form */
.auth-right {
    background: var(--bg-primary);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
}

.auth-header {
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Form Styles */
.auth-form {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.form-group:focus-within label {
    color: var(--accent-primary);
}

.form-group input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px var(--accent-light), 0 4px 12px rgba(122, 162, 247, 0.15);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-label a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.checkbox-label a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.forgot-link {
    font-size: 14px;
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.forgot-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
    transform: translateX(2px);
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(122, 162, 247, 0.3);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(122, 162, 247, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.auth-divider span {
    position: relative;
    background: var(--bg-primary);
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Social Buttons */
.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

/* Full-width Google button when it's the only social login option */
.btn-google-full {
    grid-column: 1 / -1;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-social::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(122, 162, 247, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-social:hover::before {
    width: 300px;
    height: 300px;
}

.btn-social:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 162, 247, 0.15);
}

.btn-social svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-social:hover svg {
    transform: scale(1.1);
}

/* Footer */
.auth-footer {
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.8s backwards;
}

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

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    background: rgba(247, 118, 142, 0.1);
    border: 1px solid var(--error);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--error);
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.success-message {
    background: rgba(158, 206, 106, 0.1);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--success);
    font-size: 14px;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Loading State */
.btn-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* Selection styling */
::selection {
    background: var(--accent-primary);
    color: white;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}