/* ============================================ */
/* SWIFTON LOGIN MODAL - EXACT DESIGN SPECS    */
/* ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

/* ============ CSS Variables ============ */
:root {
    /* Primary Colors */
    --red-primary: #FF0000;
    --red-dark: #CC0000;
    --blue-primary: #1075CD;
    --blue-dark: #0B5AA3;

    /* Background Colors */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --red-50: #FEF2F2;

    /* Text Colors */
    --text-gray-800: #1F2937;
    --text-gray-700: #374151;
    --text-gray-600: #4B5563;
    --text-gray-500: #6B7280;
    --text-gray-400: #9CA3AF;
    --text-gray-300: #D1D5DB;

    /* Border Colors */
    --border-gray-200: #E5E7EB;
    --border-gray-300: #D1D5DB;
    --border-gray-400: #9CA3AF;
    --border-red: #FF0000;

    /* Backdrop */
    --backdrop: rgba(0, 0, 0, 0.7);

    /* Typography */
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-4xl: 2.25rem;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
}

body {
    font-family: var(--font-family);
}

/* ============ Backdrop ============ */
.auth-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
}

/* ============ Modal Container ============ */
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 520px;
    max-height: 95vh;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 51;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ============ Close Button ============ */
.auth-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 9999px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.auth-close-btn:hover {
    background: var(--white);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.auth-close-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-gray-700);
    stroke-width: 2;
}

/* ============ Header Section ============ */
.auth-header {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--blue-primary) 100%);
    padding: 80px 40px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}

.auth-header-deco {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    z-index: 0;
    pointer-events: none;
}

.auth-header-deco-1 {
    top: 0;
    right: 0;
    width: 160px;
    height: 160px;
    margin-right: -80px;
    margin-top: -80px;
}

.auth-header-deco-2 {
    bottom: 0;
    left: 0;
    width: 128px;
    height: 128px;
    margin-left: -64px;
    margin-bottom: -64px;
}

.auth-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.auth-header-icon {
    width: 96px;
    height: 96px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 3;
}

.auth-header-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 2;
    color: var(--white);
}

.auth-header-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin-bottom: 16px;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 3;
}

.auth-header-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--text-lg);
    position: relative;
    z-index: 3;
}

/* ============ Content Section ============ */
.auth-content {
    padding: 36px 40px;
    flex: 1;
}

/* ============ Error Message ============ */
.auth-error {
    margin-bottom: 28px;
    background: var(--red-50);
    border: 2px solid var(--red-primary);
    color: var(--red-primary);
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-error.hidden {
    display: none;
}

.auth-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
}

.auth-error span {
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
}

/* ============ Mode Toggle ============ */
.auth-toggle-group {
    display: flex;
    gap: 12px;
    margin-bottom: 36px;
}

.auth-toggle-btn {
    flex: 1;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: var(--font-bold);
    font-size: var(--text-base);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-100);
    color: var(--text-gray-600);
}

.auth-toggle-btn:hover:not(.active) {
    background: var(--gray-200);
}

.auth-toggle-btn.active {
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.auth-toggle-btn[data-mode="login"].active {
    background: var(--red-primary);
}

.auth-toggle-btn[data-mode="signup"].active {
    background: var(--blue-primary);
}

/* ============ Forms ============ */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form-group {
    margin-bottom: 24px;
}

.auth-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-gray-800);
    margin-bottom: 12px;
}

/* ============ Input Wrapper ============ */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--blue-primary);
    pointer-events: none;
    stroke-width: 2;
}

.auth-input {
    width: 100%;
    padding: 16px 20px;
    font-size: var(--text-base);
    border: 2px solid var(--border-gray-200);
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    padding-left: 56px;
}

.auth-input-wrapper:has(.auth-password-toggle) .auth-input {
    padding-right: 56px;
}

.auth-input:focus {
    border-color: var(--blue-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(16, 117, 205, 0.1);
}

.auth-input::placeholder {
    color: var(--text-gray-400);
}

/* ============ Password Toggle ============ */
.auth-password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-gray-400);
    transition: color 0.3s ease;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle:hover {
    color: var(--blue-primary);
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.eye-icon.hidden,
.eye-off-icon.hidden {
    display: none;
}

/* ============ Form Footer (Remember Me & Forgot) ============ */
.auth-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
    margin-bottom: 8px;
    margin-top: 12px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 2px solid var(--border-gray-300);
    border-radius: 4px;
    accent-color: var(--red-primary);
}

.auth-checkbox:focus {
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

.auth-checkbox-label span {
    font-size: var(--text-base);
    color: var(--text-gray-700);
    font-weight: var(--font-medium);
    transition: color 0.3s ease;
}

.auth-checkbox-label:hover span {
    color: var(--blue-primary);
}

.auth-forgot-link {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--blue-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-forgot-link:hover {
    color: var(--red-primary);
}

/* ============ Submit Buttons ============ */
.auth-submit-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--white);
}

.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-submit-btn .btn-text {
    transition: opacity 0.3s ease;
}

.auth-submit-login {
    background: linear-gradient(to right, var(--red-primary), var(--red-dark));
    box-shadow: 0 10px 15px -3px rgba(255, 0, 0, 0.3);
    margin-top: 32px;
}

.auth-submit-login:hover:not(:disabled) {
    box-shadow: 0 20px 25px -5px rgba(255, 0, 0, 0.5);
}

.auth-submit-signup {
    background: linear-gradient(to right, var(--blue-primary), var(--blue-dark));
    box-shadow: 0 10px 15px -3px rgba(16, 117, 205, 0.3);
    margin-top: 28px;
}

.auth-submit-signup:hover:not(:disabled) {
    box-shadow: 0 20px 25px -5px rgba(16, 117, 205, 0.5);
}

/* ============ Spinner ============ */
.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============ Divider ============ */
.auth-divider {
    position: relative;
    margin: 32px 0;
}

.auth-divider-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 2px solid var(--border-gray-200);
    transform: translateY(-50%);
}

.auth-divider-text {
    position: relative;
    display: flex;
    justify-content: center;
    background: var(--white);
    padding: 0 20px;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-gray-500);
}

/* ============ Google Button ============ */
.auth-google-btn {
    width: 100%;
    background: var(--white);
    border: 2px solid var(--border-gray-300);
    color: var(--text-gray-800);
    padding: 16px;
    border-radius: 12px;
    font-weight: var(--font-bold);
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.auth-google-btn:hover:not(:disabled) {
    border-color: var(--border-gray-400);
    background: var(--gray-50);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.auth-google-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-google-btn svg {
    width: 24px;
    height: 24px;
}

/* ============ Terms & Privacy ============ */
.auth-terms {
    font-size: var(--text-sm);
    color: var(--text-gray-500);
    text-align: center;
    margin-top: 24px;
    line-height: var(--leading-relaxed);
}

.auth-terms-link {
    color: var(--blue-primary);
    font-weight: var(--font-semibold);
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ============ Responsive Design ============ */
@media (max-width: 640px) {
    .auth-modal {
        width: 100%;
        max-width: none;
        border-radius: 16px;
        max-height: 100vh;
    }

    .auth-header {
        padding: 32px 24px;
    }

    .auth-header-title {
        font-size: 28px;
    }

    .auth-header-subtitle {
        font-size: 16px;
    }

    .auth-header-icon {
        width: 64px;
        height: 64px;
    }

    .auth-header-icon svg {
        width: 32px;
        height: 32px;
    }

    .auth-content {
        padding: 24px 20px;
    }

    .auth-close-btn {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .auth-close-btn svg {
        width: 18px;
        height: 18px;
    }

    .auth-form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ============ Utility Classes ============ */
.hidden {
    display: none;
}

