@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

/* ==========================
   ROOT VARIABLES - MODERN SAAS THEME
========================== */
:root {
    /* Modern SAAS Color Palette */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #8b5cf6;
    --color-primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --color-secondary: #64748b;
    --color-secondary-hover: #475569;

    --color-bg: #f8fafc;
    --color-bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --color-surface: #ffffff;
    --color-surface-light: rgba(255, 255, 255, 0.8);

    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-danger: #ef4444;
    --color-danger-light: #fef2f2;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-lighter: #94a3b8;
    --color-text-lightest: #f1f5f9;

    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    /* Fonts */
    --font-base: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;

    /* Z-index */
    --z-background: 0;
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 100;
    --z-modal: 1000;
}

/* ==========================
   CSS RESET & BASE STYLES
========================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    background: var(--color-bg-gradient);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================
   TYPOGRAPHY UTILITIES
========================== */
.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}
.text-base {
    font-size: 1rem;
}
.text-lg {
    font-size: 1.125rem;
}
.text-xl {
    font-size: 1.25rem;
}
.text-2xl {
    font-size: 1.5rem;
}
.text-3xl {
    font-size: 1.875rem;
}

.font-normal {
    font-weight: 400;
}
.font-medium {
    font-weight: 500;
}
.font-semibold {
    font-weight: 600;
}
.font-bold {
    font-weight: 700;
}

/* ==========================
   LAYOUT UTILITIES
========================== */
.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.items-start {
    align-items: flex-start;
}
.justify-center {
    justify-content: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-2 {
    gap: var(--space-2);
}
.gap-3 {
    gap: var(--space-3);
}
.gap-4 {
    gap: var(--space-4);
}
.gap-6 {
    gap: var(--space-6);
}

.w-full {
    width: 100%;
}
.w-auto {
    width: auto;
}
.max-w-sm {
    max-width: 24rem;
}
.max-w-md {
    max-width: 28rem;
}
.max-w-lg {
    max-width: 32rem;
}

/* ==========================
   SPACING UTILITIES
========================== */
.m-0 {
    margin: 0;
}
.mb-2 {
    margin-bottom: var(--space-2);
}
.mb-3 {
    margin-bottom: var(--space-3);
}
.mb-4 {
    margin-bottom: var(--space-4);
}
.mb-6 {
    margin-bottom: var(--space-6);
}
.mb-8 {
    margin-bottom: var(--space-8);
}

.p-0 {
    padding: 0;
}
.p-4 {
    padding: var(--space-4);
}
.p-6 {
    padding: var(--space-6);
}
.p-8 {
    padding: var(--space-8);
}
.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}
.py-6 {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

/* ==========================
   AUTH COMPONENTS
========================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    position: relative;
}

.auth-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: var(--z-background);
}

.auth-graphics {
    position: relative;
    width: 100%;
    height: 100%;
}

.graphic-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--color-primary-gradient);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: 100px;
    left: -100px;
    animation-delay: 2s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.auth-card {
    background: var(--color-surface);
    padding: var(--space-12);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: var(--z-base);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-light);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 90px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-3);
    line-height: 1.2;
}

.auth-header p {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ==========================
   FORM COMPONENTS
========================== */
.auth-form {
    margin-bottom: var(--space-6);
}

.input-group {
    position: relative;
    margin-bottom: var(--space-6);
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-lighter);
    transition: var(--transition-normal);
    z-index: var(--z-base);
}

.input-group input {
    width: 100%;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-16);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--color-bg);
    transition: var(--transition-normal);
}

.input-group input:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.input-group.focused .input-icon {
    color: var(--color-primary);
}

/* ==========================
   FORM OPTIONS & CHECKBOX
========================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    font-size: 0.875rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--color-text-light);
    gap: var(--space-3);
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition-normal);
    flex-shrink: 0;
}

.checkbox-container input:checked + .checkmark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-container input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================
   BUTTON COMPONENTS
========================== */
.auth-button {
    width: 100%;
    background: var(--color-primary-gradient);
    color: white;
    border: none;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: var(--transition-normal);
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-button:active {
    transform: translateY(0);
}

.button-icon {
    transition: var(--transition-normal);
}

.auth-button:hover .button-icon {
    transform: translateX(4px);
}

/* ==========================
   MESSAGE COMPONENTS
========================== */
.message {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: var(--space-6);
}

.error-message {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid #fecaca;
}

.success-message {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid #a7f3d0;
}

/* ==========================
   LINK COMPONENTS
========================== */
.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-link:hover {
    color: var(--color-primary-hover);
}

.forgot-password {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.forgot-password:hover {
    color: var(--color-primary-hover);
}

/* ==========================
   AUTH FOOTER
========================== */
.auth-footer {
    text-align: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* ==========================
   PASSWORD STRENGTH
========================== */
.password-strength {
    margin-top: var(--space-2);
}

.strength-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: var(--space-2);
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition-normal);
    border-radius: var(--radius-sm);
}

.strength-weak {
    width: 33%;
    background: var(--color-danger);
}
.strength-medium {
    width: 66%;
    background: var(--color-warning);
}
.strength-strong {
    width: 100%;
    background: var(--color-success);
}

/* ==========================
   RESPONSIVE DESIGN
========================== */
@media (max-width: 480px) {
    .auth-container {
        padding: var(--space-4);
    }

    .auth-card {
        padding: var(--space-8);
    }

    .auth-header h1 {
        font-size: 1.75rem;
    }

    .form-options {
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo i {
        font-size: 1.75rem;
    }
}

/* ==========================
   ACCESSIBILITY
========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.auth-button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border: #000000;
        --color-text-light: #000000;
    }
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Spinner */
.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--color-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Hidden class */
.hidden {
    display: none;
}
