/* ===========================
   AUTHENTICATION STYLES
   =========================== */

:root {
    --primary-color: var(--color-primary);
    --primary-dark: var(--color-primary-dark);
    --primary-light: var(--color-primary-light);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #0f172a;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f1f5f9;
    background-image: radial-gradient(ellipse at 20% 10%, rgba(71, 85, 105, 0.06) 0%, transparent 55%),
                      radial-gradient(ellipse at 80% 90%, rgba(100, 116, 139, 0.05) 0%, transparent 55%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-100px, -100px);
    }
}

/* ===========================
   AUTH CONTAINER
   =========================== */

.auth-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 620px;
    margin: 2rem;
    background: var(--bg-primary);
    border-radius: 24px;
    box-shadow: 0 32px 60px -12px rgba(15, 23, 42, 0.22),
                0 12px 24px -8px rgba(15, 23, 42, 0.10),
                0 0 0 1px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ===========================
   BRAND SIDE
   =========================== */

.auth-brand {
    flex: 1;
    background: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%);
    color: var(--text-primary);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: color-mix(in srgb, var(--color-primary) 5%, transparent);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: color-mix(in srgb, var(--color-primary) 3%, transparent);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.logo-image {
    max-width: 200px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.brand-tagline {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--success-color);
}

/* ===========================
   FORM SIDE
   =========================== */

.auth-form-container {
    flex: 1;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===========================
   ALERT MESSAGE
   =========================== */

.alert {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.75rem;
    animation: slideDown 0.3s ease;
    backdrop-filter: blur(10px);
}

.alert i:first-child {
    font-size: 1.125rem;
}

.alert span {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    border-radius: 6px;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ===========================
   FORM STYLES
   =========================== */

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.input-wrapper input:not([type="password"]):not([id="password"]) {
    padding-right: 1rem;
}

.input-wrapper input:hover:not(:focus) {
    border-color: #cbd5e1;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #f8fafc;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 10%, transparent),
                0 1px 3px rgba(15, 23, 42, 0.05);
}

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

.input-wrapper input.error {
    border-color: var(--error-color);
}

.toggle-password {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    transition: all 0.2s;
    border-radius: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.toggle-password:hover {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.toggle-password i {
    font-size: 1rem;
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

/* ===========================
   FORM OPTIONS
   =========================== */

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

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.checkbox-wrapper:hover .checkmark {
    border-color: var(--primary-light);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.625rem;
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

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

/* ===========================
   BUTTONS
   =========================== */

.btn-primary {
    width: 100%;
    padding: 0.9375rem 1.5rem;
    /* background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%); */
    color: black;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 32%, transparent),
                0 1px 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.btn-icon {
    transition: transform 0.3s;
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* ===========================
   FOOTER
   =========================== */

.auth-footer {
    margin-top: 2.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ===========================
   LOADING OVERLAY
   =========================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.25rem;
    font-weight: 500;
}

/* ===========================
   ANIMATIONS
   =========================== */

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

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

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 968px) {
    .auth-brand {
        display: none;
    }

    .auth-container {
        margin: 1rem;
    }
}

@media (max-width: 576px) {
    .auth-container {
        margin: 0.5rem;
        border-radius: 10px;
    }

    .auth-form-container {
        padding: 2rem 1.5rem;
    }

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

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
