﻿/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme colors */
    --primary-dark-blue: #1e3a8a;
    --primary-green: #10b981;
    --accent-red: #ef4444;
    --gradient-primary: linear-gradient(135deg, var(--primary-dark-blue) 0%, var(--primary-green) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--accent-red) 0%, var(--primary-green) 100%);
    --gradient-accent: linear-gradient(135deg, var(--primary-dark-blue) 0%, var(--accent-red) 50%, var(--primary-green) 100%);
    
    /* Light theme backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.1);
    
    /* Light theme text colors */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    /* Light theme UI colors */
    --border-color: #e2e8f0;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Component specific */
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus: var(--primary-dark-blue);
}

/* Dark theme colors */
[data-theme="dark"] {
    --bg-primary: #0a0f1c;
    --bg-secondary: #1a2332;
    --bg-card: rgba(26, 35, 50, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    --input-bg: #1a2332;
    --input-border: #2d3748;
    --input-focus: var(--primary-green);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* ===== Main Container ===== */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
}

/* ===== Background Shapes ===== */
.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 5%;
    left: 4%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 70%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* ===== Auth Container ===== */
.auth-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 820px;
    z-index: 10;
    perspective: 1000px;
}

.form-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-heavy);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Form Container Animations */
.login-container {
    transform: translateX(0%);
    opacity: 1;
    z-index: 2;
}

.login-container.hide {
    transform: translateX(-100%);
    opacity: 0;
    z-index: 1;
}

.signup-container {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
}

.signup-container.active {
    transform: translateX(0%);
    opacity: 1;
    z-index: 2;
}

/* ===== Form Content ===== */
.form-content {
    padding: 3rem 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== Logo Section ===== */
.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--gradient-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.logo:hover {
    transform: rotate(10deg) scale(1.05);
}

.brand-name {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

/* ===== Form Styles ===== */
.auth-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* ===== Input Styles ===== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    height: 50px;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

/* Label default position */
.input-wrapper label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: var(--input-bg);
    padding: 0 0.4rem;
}

/* Focus or has content: move label to center of border */
.input-wrapper input:focus + label,
.input-wrapper input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%);
    left: 2.5rem;
    font-size: 0.75rem;
    border-radius: 2rem;
background: linear-gradient(
  to right,
  rgba(2, 52, 117, 0.2),
  rgba(0, 255, 0, 0.2)
);
    color: var(--primary-green);
}

/* Optional: add small notch effect to make label sit cleanly on border */
.input-wrapper input {
    position: relative;
    z-index: 1;
}

.input-wrapper label {
    z-index: 2;
}
.input-group {
    margin-bottom: 2rem; /* Increase this value for more vertical space */
}

.input-group:last-of-type {
    margin-bottom: 2.5rem; /* Extra space before buttons */
}


.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    z-index: 2;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--text-primary);
}

.error-message {
    display: block;
    color: var(--primary-red);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Form Options ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--input-border);
    border-radius: 4px;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--gradient-primary);
    border-color: var(--primary-dark-blue);
}

.checkbox-container input:checked ~ .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.7rem;
}

.forgot-password {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-red);
}

/* ===== Button Styles ===== */
.auth-button {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
    margin-bottom: 1.5rem;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.auth-button:hover i {
    transform: translateX(5px);
}

/* ===== Social Login ===== */
.social-login {
    text-align: center;
    margin-bottom: 1.5rem;
}

.social-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    position: relative;
}

.social-text::before,
.social-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--border-color);
}

.social-text::before { left: 0; }
.social-text::after { right: 0; }

.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.google-btn:hover { border-color: #4285F4; color: #4285F4; }
.facebook-btn:hover { border-color: #1877F2; color: #1877F2; }
.linkedin-btn:hover { border-color: #0A66C2; color: #0A66C2; }

/* ===== Switch Form ===== */
.switch-form {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.switch-form a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.switch-form a:hover {
    color: var(--primary-red);
}

/* ===== Responsive Design ===== */

/* Tablet Styles */
@media screen and (max-width: 1024px) {
    .main-container {
        padding: 1.5rem;
    }
    
    .auth-container {
        max-width: 450px;
        height: 700px;
    }
    
    .background-shapes .shape {
        opacity: 0.5;
    }
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    .main-container {
        padding: 1rem;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 5rem;
    }
    
    .auth-container {
        max-width: 100%;
        height: auto;
        min-height: 600px;
    }
    
    .form-content {
        padding: 2rem 1.5rem;
    }
    
    .logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .brand-name {
        font-size: 1.5rem;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .input-wrapper input {
        height: 48px;
        font-size: 0.9rem;
    }
    
    .auth-button {
        height: 48px;
        font-size: 0.95rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .social-buttons {
        gap: 0.75rem;
    }
    
    .social-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .background-shapes .shape {
        opacity: 0.3;
    }
    
    .shape-1 {
        width: 200px;
        height: 200px;
    }
    
    .shape-2 {
        width: 150px;
        height: 150px;
    }
    
    .shape-3 {
        width: 100px;
        height: 100px;
    }
}

/* Small Mobile Styles */
@media screen and (max-width: 480px) {
    .form-content {
        padding: 1.5rem 1rem;
    }
    
    .logo-section {
        margin-bottom: 1.5rem;
    }
    
    .input-group {
        margin-bottom: 1.25rem;
    }
    
    .form-options {
        margin-bottom: 1.5rem;
    }
    
    .social-login {
        margin-bottom: 1rem;
    }
    
    .auth-container {
        border-radius: 15px;
    }
    
    .form-container {
        border-radius: 15px;
    }
}

/* ===== Animation Classes ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== Loading Animation ===== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading span {
    opacity: 0;
}

/* ===== Focus Visible for Accessibility ===== */
.auth-button:focus-visible,
.social-btn:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary-dark-blue);
    outline-offset: 2px;
}

[data-theme="dark"] .auth-button:focus-visible,
[data-theme="dark"] .social-btn:focus-visible,
[data-theme="dark"] .theme-toggle:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.input-wrapper input:focus-visible {
    outline: none;
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-muted: #333333;
    }
    
    [data-theme="dark"] {
        --border-color: #ffffff;
        --text-muted: #cccccc;
    }
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .background-shapes .shape {
        animation: none;
    }
}