﻿/* =====================================================
   Authentication Page (Login/Register)
   ===================================================== */
body.auth-page {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #1e40af !important;
    /* Solid Royal Blue */
    position: relative;
    overflow-x: hidden;
    padding: 1.5rem;
    margin: 0 !important;
}

/* Dynamic background effects */
.auth-page::before,
.auth-page::after {
    content: '';
    position: fixed;
    /* Changed to fixed to prevent scrollbar */
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    z-index: 0;
    animation: float 20s infinite alternate;
}

.auth-page::before {
    background: var(--secondary);
    top: -150px;
    left: -150px;
}

.auth-page::after {
    background: var(--primary);
    bottom: -150px;
    right: -150px;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2.5rem 2.5rem 1.5rem;
    /* Reduced bottom padding specifically */
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 1);
    position: relative;
    z-index: 10;
    margin: auto !important;
    display: flex;
    flex-direction: column;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
    /* Reduced margin */
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-logo img {
    width: 80px !important;
    height: 80px !important;
    object-fit: contain;
}

.auth-title {
    font-size: 1.75rem;
    /* Slightly smaller */
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    /* Reduced margin */
}

/* Form Styles */
.auth-page .form-label {
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.625rem;
    display: block;
    text-align: left;
}

.auth-page .form-control {
    background: rgba(249, 250, 251, 0.8);
    border-color: var(--gray-300);
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.auth-page .form-control:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
    transform: translateY(-1px);
}

.auth-page .input-group-text,
.auth-page button[onclick="togglePassword()"] {
    color: var(--gray-500) !important;
    transition: color 0.3s ease;
}

.auth-page button[onclick="togglePassword()"]:hover {
    color: var(--primary) !important;
}

.auth-page .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    background: var(--primary);
    border: none;
    box-shadow: 0 10px 20px -5px rgba(30, 64, 175, 0.4);
    margin-top: 0.5rem;
    /* Reduced margin */
    transition: all 0.3s ease;
    color: var(--white);
    text-transform: capitalize;
}

.auth-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(30, 64, 175, 0.5);
    background: var(--primary-dark);
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    /* Further reduced margin */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Further reduced gap */
    align-items: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.auth-link-small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary) !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-link-small:hover {
    text-decoration: underline;
    color: var(--secondary-dark) !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.text-right {
    text-align: right !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: slideUp 0.5s ease-out forwards;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .auth-page {
        padding: 1rem;
        /* Keep gradient background */
        align-items: center;
        /* Center vertically on mobile too */
    }

    .auth-card {
        padding: 1.5rem;
        width: 100%;
        margin: 0;
        /* Keep glassmorphism */
    }

    .auth-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

/* =====================================================
   Auth Utils (Icons & Toggles) 
   ===================================================== */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i:first-child {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 10;
    transition: color 0.3s ease;
}

.input-with-icon:focus-within i:first-child {
    color: var(--primary);
}

.input-with-icon .form-control {
    padding-left: 42px !important;
    /* Ensure space for icon */
    padding-right: 45px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 4px;
    height: 100%;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary);
    background: rgba(30, 64, 175, 0.05);
    border-radius: 0 0.75rem 0.75rem 0;
}

.auth-btn-lg {
    height: 50px;
    margin-top: 1rem;
}

.auth-link-secondary {
    color: var(--gray-500) !important;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.auth-link-secondary:hover {
    color: var(--primary) !important;
}

.auth-alert-anim {
    animation: slideUp 0.3s ease-out;
}

/* Register Page Specifics */
.auth-card.register-mode {
    max-width: 700px;
    /* Wider card for 2 columns */
}

/* Form Grid for Compact Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .auth-card.register-mode {
        max-width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 0;
    }
}

/* Page Transition Overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    /* Royal Blue */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.transition-content {
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-transition-overlay.active .transition-content {
    transform: scale(1);
}

.transition-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
    animation: rotateLogo 2s infinite linear;
    display: none;
    /* Hidden strictly by default */
}

.page-transition-overlay.active .transition-logo {
    display: inline-block;
}

@keyframes rotateLogo {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.transition-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.2s;
}

.page-transition-overlay.active .transition-text {
    opacity: 1;
    transform: translateY(0);
}