/**
 * Login Page Specific Styles
 * SchoolX - School Management System
 */

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Custom scrollbar for login page */
.login-page::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.login-page::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.login-page::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.login-page::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   LOGIN PAGE STYLES - PREMIUM SAAS
   ======================================== */

/* ===== LEFT PANEL: Brand Section ===== */

.brand-panel {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wave/Curve Shape using CSS */
.brand-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10%;
    width: 120%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    clip-path: ellipse(60% 100% at 100% 50%);
    opacity: 0.3;
    pointer-events: none;
}

/* Geometric pattern overlay */
.brand-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 30px 30px;
    color: white;
}

.brand-logo-wrapper {
    margin-bottom: 20px;
}

.brand-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-8px) rotate(-2deg);
    }

    50% {
        transform: translateY(-15px) rotate(0deg);
    }

    75% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.brand-title {
    font-size: 38px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    letter-spacing: -1px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brand-tagline {
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    line-height: 1.6;
    letter-spacing: 0.3px;
    opacity: 0.9;
}

.brand-features {
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 400;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateX(5px);
}

.feature-item i {
    font-size: 16px;
    margin-right: 12px;
    color: #60a5fa;
    text-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

/* SVG Wave Divider - Spacer Design */
.wave-separator {
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    width: 80px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.wave-separator svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
}

/* ===== RIGHT PANEL: Form Section ===== */

.form-panel {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
}

.form-container {
    width: 100%;
    max-width: 460px;
    padding: 10px;
}

/* Mobile Logo */
.mobile-logo {
    text-align: center;
    margin-bottom: 25px;
}

.mobile-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}

.mobile-logo h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Form Header */
.form-header {
    margin-bottom: 25px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.form-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Modern Form Styles */
.modern-form {
    margin-bottom: 30px;
}

/* Material Design Floating Label Inputs */
.form-floating-custom {
    position: relative;
    margin-bottom: 25px;
}

.form-control-custom {
    width: 100%;
    padding: 14px 0 8px 0;
    font-size: 1.1rem;
    color: #1e293b;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

/* PIN Field - Spacious letter spacing for dots */
#pin.form-control-custom {
    letter-spacing: 1.5rem;
    font-size: 1.2rem;
    text-align: center;
}

.form-control-custom:focus {
    background-color: transparent !important;
    border-bottom: 2px solid #2563eb !important;
    box-shadow: none !important;
    padding-bottom: 7px;
}

.form-floating-custom label {
    position: absolute;
    left: 0;
    top: 14px;
    font-size: 15px;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
}

/* Label animation when input is focused or has value */
.form-control-custom:focus+label,
.form-control-custom:not(:placeholder-shown)+label,
.form-select:focus+label,
.form-floating-custom.has-value label {
    top: -10px;
    font-size: 13px;
    color: #2563eb;
    font-weight: 500;
}

/* Specific fix for standard selects in floating labels */
.form-floating-custom select.form-select {
    padding-top: 20px !important;
    padding-bottom: 5px !important;
    height: 52px !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.form-floating-custom select.form-select:focus {
    border-bottom-color: #2563eb !important;
}

/* Select2 Material Design - Match form-control-custom */
.form-floating-custom .select2-container--bootstrap-5 .select2-selection {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-radius: 0 !important;
    padding: 14px 0 8px 0 !important;
    height: auto !important;
    min-height: 48px !important;
    box-shadow: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-floating-custom .select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-bottom: 2px solid #2563eb !important;
}

/* Label animation for Select2 */
.form-floating-custom:has(.select2-container--focus) label,
.form-floating-custom.has-value label {
    top: -10px !important;
    font-size: 13px !important;
    color: #2563eb !important;
    font-weight: 500 !important;
}

/* Adjust Select2 text alignment */
.form-floating-custom .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-left: 0 !important;
    color: #1e293b !important;
    font-size: 1.1rem !important;
    line-height: 1.5 !important;
}

.form-floating-custom .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
}

/* Animated Underline */
.input-underline {
    display: none;
}

/* Form Options (Remember me & Forgot PIN) */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.form-check-label {
    color: #64748b;
    font-weight: 400;
    cursor: pointer;
}

.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.forgot-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.forgot-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Premium Login Button with Gradient and Shadow */
.btn-login-modern {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35),
        0 8px 10px -6px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-login-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.btn-login-modern:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(37, 99, 235, 0.45),
        0 10px 15px -6px rgba(37, 99, 235, 0.35);
}

.btn-login-modern:hover::before {
    left: 100%;
}

.btn-login-modern:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -5px rgba(37, 99, 235, 0.4);
}

.btn-login-modern.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-login-modern.loading #btnIcon {
    display: none;
}

/* Spinner styling */
.spinner-border-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* Modern Divider */
.divider-modern {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.divider-modern span {
    position: relative;
    background: white;
    padding: 0 18px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Modern Biometric Button */
.btn-biometric-modern {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white !important;
    border: none;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.3),
        0 8px 10px -6px rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-biometric-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.btn-biometric-modern:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.45),
        0 10px 15px -6px rgba(16, 185, 129, 0.35);
    color: white !important;
}

.btn-biometric-modern:hover::before {
    left: 100%;
}

.btn-biometric-modern:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -5px rgba(16, 185, 129, 0.4);
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.form-footer p {
    color: #94a3b8;
    font-size: 13px;
    margin: 0;
    font-weight: 400;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 991px) {
    .brand-title {
        font-size: 32px;
    }

    .brand-tagline {
        font-size: 15px;
    }

    .brand-logo {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 767px) {
    .form-panel {
        padding: 15px 15px;
    }

    .form-container {
        padding: 0 10px;
    }

    .form-title {
        font-size: 24px;
    }

    .form-subtitle {
        font-size: 13px;
    }

    .left-panel.brand-panel {
        width: 100%;
        min-height: 25vh;
        position: relative;
        padding-bottom: 30px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: 20px;
    }

    .brand-content {
        padding: 15px;
        margin-top: -20px;
    }

    .brand-logo-wrapper {
        margin-bottom: 10px;
    }

    .brand-logo {
        width: 50px;
        height: 50px;
    }

    .brand-title {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .brand-tagline {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .right-panel.form-panel {
        width: 100%;
        flex-grow: 1;
        padding-top: 1rem;
        align-items: flex-start;
    }

    .form-container {
        padding: 0 15px;
        max-width: 100%;
    }

    .form-header {
        margin-bottom: 15px;
        text-align: center;
    }

    .form-title {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .form-subtitle {
        font-size: 13px;
    }

    .form-floating-custom {
        margin-bottom: 15px;
    }

    .modern-form {
        margin-bottom: 15px;
    }

    .form-options {
        margin-bottom: 15px;
    }

    .btn-login-modern {
        padding: 12px;
    }

    /* Position the mobile wave at the bottom of the blue header */
    .wave-mobile {
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 50px;
        z-index: 10;
        line-height: 0;
        pointer-events: none;
    }

    .wave-mobile svg {
        display: block;
        width: 100%;
        height: 100%;
        fill: #ffffff;
    }
}

@media (max-width: 576px) {
    .mobile-logo {
        margin-bottom: 20px;
    }

    .form-header {
        margin-bottom: 18px;
    }

    .btn-login-modern,
    .btn-biometric-modern {
        padding: 12px 18px;
        font-size: 15px;
    }

    .form-title {
        font-size: 22px;
    }

    .form-floating-custom {
        margin-bottom: 20px;
    }

    .form-footer {
        margin-top: 10px;
        padding-top: 10px;
    }

    .divider-modern {
        margin: 10px 0;
    }
}

/* FORCE inputs to be white/transparent even with Autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #334155 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Ensure the input line remains visible */
.form-control-custom {
    background-color: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
}