/* Enhanced Authentication Pages Styles */

/* DON'T hide navigation on auth pages - REMOVED */
/* Keep footer hidden though */
body.auth-page:not(.non-auth) footer,
body.auth-page:not(.non-auth) .modern-footer {
    display: none !important;
}

/* Make container account for fixed header height */
body.auth-page:not(.non-auth) .modern-container {
    min-height: calc(100vh - 80px); /* Subtract header height */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 20px 20px;
    margin-top: 0; /* Account for sticky header */
}

body.auth-page:not(.non-auth) .modern-main {
    display: contents;
}

body.auth-page:not(.non-auth) .container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 20px 20px;
}

/* Ensure normal layout for non-auth pages */
body:not(.auth-page) .container,
body.non-auth .container,
body:not(.auth-page) .modern-container,
body.non-auth .modern-container {
    height: auto !important;
    display: block !important;
    align-items: normal !important;
    justify-content: normal !important;
}

body:not(.auth-page) .modern-main,
body.non-auth .modern-main {
    display: block !important;
}

/* Enhanced auth card with modern effects */
.auth-card {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: auto 0;
}

    /* Subtle glow effect */
    .auth-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.5), transparent);
    }

    .auth-card:hover {
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 
                    0 0 0 1px rgba(96, 165, 250, 0.2);
    }

/* Main title with gradient */
.auth-title {
    color: #f1f5f9;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Subtitle */
.auth-subtitle {
    color: #94a3b8;
    font-size: 16px;
    text-align: center;
    margin-bottom: 36px;
    line-height: 1.5;
}

/* Form group spacing */
.auth-card .form-group {
    margin-bottom: 24px;
}

/* Form labels */
.form-label-custom {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.2px;
}

/* Enhanced form inputs */
.form-control-custom {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

    .form-control-custom:focus {
        outline: none;
        background: rgba(30, 41, 59, 1);
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
        transform: translateY(-1px);
    }

    .form-control-custom::placeholder {
        color: #64748b;
    }

    .form-control-custom:hover:not(:focus) {
        border-color: rgba(148, 163, 184, 0.3);
    }

/* Form hint text */
.form-hint {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
}

/* Remember me and forgot password row */
.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #60a5fa;
    cursor: pointer;
}

.checkbox-label {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.forgot-password {
    color: #60a5fa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .forgot-password:hover {
        color: #a855f7;
        text-decoration: none;
    }

/* Enhanced submit button */
.btn-auth {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.3);
    margin-bottom: 32px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 14px;
}

    .btn-auth:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 30px rgba(96, 165, 250, 0.4);
        background: linear-gradient(135deg, #3b82f6, #9333ea);
    }

    .btn-auth:active {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
    }

    .btn-auth:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Divider */
.auth-divider {
    text-align: center;
    margin: 32px 0;
    color: #64748b;
    font-size: 13px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .auth-divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.2), transparent);
        z-index: 1;
    }

    .auth-divider span {
        background: rgba(15, 23, 42, 0.95);
        padding: 0 16px;
        position: relative;
        z-index: 2;
    }

/* Register/Login links */
.register-link {
    text-align: center;
}

.register-text {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

    .register-text a {
        color: #60a5fa;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
    }

        .register-text a:hover {
            color: #a855f7;
            text-decoration: none;
        }

/* Validation errors */
.validation-error {
    color: #f87171;
    font-size: 12px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.validation-summary {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

    .validation-summary ul {
        margin: 0;
        padding-left: 20px;
        color: #f87171;
    }

/* Input icons (optional enhancement) */
.form-group {
    position: relative;
}

.form-control-custom:focus + .input-icon {
    color: #60a5fa;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-card {
        max-width: 440px;
        padding: 40px 32px;
    }

    body.auth-page:not(.non-auth) .modern-container,
    body.auth-page:not(.non-auth) .container {
        padding: 30px 20px 20px 20px;
    }
}

/* Mobile optimization - fit to screen height */
@media (max-width: 480px) {
    /* Adjust for sticky header on mobile */
    body.auth-page:not(.non-auth) .modern-container,
    body.auth-page:not(.non-auth) .container {
        height: auto;
        min-height: 100vh;
        padding: 10px;
        align-items: flex-start;
        justify-content: flex-start;
        overflow: auto;
    }

    /* Compact card for mobile */
    .auth-card {
        padding: 20px 16px;
        margin: 10px auto;
        max-width: calc(100% - 20px);
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .auth-title {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .auth-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .checkbox-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
    }

    .forgot-password {
        align-self: flex-end;
    }

    .form-control-custom {
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .btn-auth {
        padding: 12px;
        font-size: 13px;
        margin-bottom: 16px;
        border-radius: 10px;
    }

    /* Compact form groups on mobile */
    .auth-card .form-group {
        margin-bottom: 14px;
    }

    .form-label-custom {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-hint {
        font-size: 11px;
        margin-top: 4px;
    }

    /* Compact divider spacing */
    .auth-divider {
        margin: 16px 0;
        font-size: 12px;
    }

    .register-text {
        font-size: 13px;
    }
}

/* Extra small devices - ultra compact */
@media (max-width: 360px) {
    .auth-card {
        padding: 16px 14px;
        margin: 8px auto;
    }

    .auth-title {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .auth-subtitle {
        font-size: 12px;
        margin-bottom: 14px;
    }

    .auth-card .form-group {
        margin-bottom: 12px;
    }

    .form-label-custom {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .btn-auth {
        padding: 11px;
        margin-bottom: 14px;
        font-size: 12px;
    }

    .auth-divider {
        margin: 14px 0;
    }

    .form-control-custom {
        padding: 9px 11px;
        font-size: 13px;
    }

    .form-hint {
        font-size: 10px;
    }

    .register-text {
        font-size: 12px;
    }
}

/* Loading state for button */
.btn-auth.loading {
    position: relative;
    color: transparent;
}

    .btn-auth.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: spinner 0.6s linear infinite;
    }

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

/* Focus visible for accessibility */
.checkbox-custom:focus-visible,
.form-control-custom:focus-visible,
.btn-auth:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* Allow container scroll on mobile if content is tall */
@media (max-width: 480px) {
    body.auth-page:not(.non-auth) .modern-container,
    body.auth-page:not(.non-auth) .container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 80px; /* Account for fixed header */
        padding-bottom: 20px;
    }

    /* Ensure auth card doesn't get cut off */
    .auth-card {
        margin-top: 0;
        margin-bottom: 20px;
    }
}

/* Light theme overrides for auth divider */
[data-theme="light"] .auth-divider {
    color: #64748b !important;
}

[data-theme="light"] .auth-divider::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.15), transparent) !important;
}

[data-theme="light"] .auth-divider span {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #64748b !important;
}
