/* Global Body & Layout Styles */
html,
body {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #e2e6ea !important;
    /* Light background */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #212529;
    /* Dark text */
    overflow: hidden !important;
    /* Prevent scrollbars */
}

/* Ensure the main container from base template takes full height */
body>main {
    height: 100%;
    width: 100%;
    display: block;
}

/* Main Layout Wrapper */
.login-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
    min-height: 100vh;
    /* Minimal height is full screen */
}

/* Left Section: Image & Branding */
.login-image-section {
    flex: 1.5;
    /* Larger width (approx 60%) */
    position: relative;
    display: none;
    /* Hidden on mobile by default */
}

.login-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* Overlay to darken image for text readability */
.login-image-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Composite gradient: Vertical dark fade (for text) AND Horizontal fade to white (for blend) */
    background:
        linear-gradient(to right, rgba(226, 230, 234, 0) 0%, rgba(226, 230, 234, 0) 60%, rgba(226, 230, 234, 1) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.image-overlay {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Align content to top with margin */
    justify-content: flex-start;
    padding: 80px 4rem 4rem 4rem;
}


.brand-content {
    color: white;
    /* Keep white on image overlay */
    max-width: 600px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Logo Styles */
.login-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    /* Ensure icon is visible but not distorted */
}

.brand-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.brand-text-green {
    color: #28a745;
    /* Bootstrap Success Green / UniWeb Green */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    /* Soft shadow for lift */
}

.brand-text-white {
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    /* Soft shadow for lift */
}

.brand-headline {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0.9;
    margin-top: 1rem;
}

.trust-badges {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.avatars-group {
    height: 24px;
}

.trust-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Feature Slider Customization */
/* Feature Slider Customization */
#loginFeatureCarousel {
    min-height: 300px;
    perspective: 1500px;
    /* Essential for 3D effect */
}

/* Icons & Text Styling */
.slider-icon i {
    font-size: 3rem;
    color: #28a745;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.slider-category {
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.slider-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    max-width: 500px;
    margin-top: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.brand-headline {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    /* Enhanced shadow for title */
}

/* Indicators */
.custom-indicators {
    margin-bottom: -2rem;
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 0;
}

.custom-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    margin-right: 12px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-indicators [data-bs-target].active {
    background-color: #28a745;
    width: 30px;
    border-radius: 12px;
}


/* 3D Book Page Flip Animation */
.carousel-inner.scene-3d {
    overflow: visible;
    /* Allowing 3D overflow */
    transform-style: preserve-3d;
}

.carousel-item.book-page {
    opacity: 0;
    transform-origin: left center;
    transform: rotateY(90deg) translateZ(0);
    /* Start "closed" or flipped away */
    transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1), opacity 1s ease;
    backface-visibility: hidden;
    /* Hide back side */
    display: block !important;
    /* Force block to manage transitions manually via classes */
    position: absolute;
    /* Stack them */
    top: 0;
    left: 0;
    width: 100%;
}

.carousel-item.book-page.active {
    opacity: 1;
    transform: rotateY(0deg) translateZ(0);
    /* "Open" page */
    position: relative;
    /* Active takes flow */
    z-index: 5;
}

/* Override Bootstrap's default transition to let ours take over */
.carousel-item-next,
.carousel-item-prev,
.carousel-item.active.carousel-item-start,
.carousel-item.active.carousel-item-end {
    transform: none !important;
    transition: none !important;
}

/* Manual "Exit" Animation for outgoing slide */
/* Note: Bootstrap uses .active.carousel-item-start to indicate outgoing to left */
.carousel-item.book-page.active.carousel-item-start {
    animation: bookFlipOut 1s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes bookFlipOut {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
    }

    100% {
        transform: rotateY(-30deg);
        /* Subtle flick away */
        opacity: 0;
    }
}


/* Right Section: Form */
.login-form-section {
    flex: 1;
    /* Smaller width (approx 40%) */
    max-width: 600px;
    /* Added for extra control */
    background-color: #e2e6ea;
    /* Light background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Vertical Center */
    padding: 2rem;
    position: relative;
    width: 100%;
    height: 100%;
    /* Take full height of parent */
    overflow-y: auto;
    /* Allow scrolling if vertical content is too tall */
}

.login-form-container {
    width: 100%;
    max-width: 450px;
    margin: auto;
    /* Ensure centering within flex container */
    background: #ffffff;
    /* White card */
    /* backdrop-filter removed as we want solid white */
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2), 0 10px 20px -6px rgba(0, 0, 0, 0.2);
    /* Softer shadow */
    padding: 3rem;
    border-radius: 1rem;
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #212529;
    /* Dark text */
    text-align: center;
}

.form-subtitle {
    color: #6c757d;
    /* Bootstrap secondary */
    margin-bottom: 2rem;
    font-size: 0.95rem;
    text-align: center;
}


/* Input Styling */
.form-label {
    color: #495057;
    /* Darker label */
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.custom-input-group {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    /* Standard border */
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-input-group:focus-within {
    border-color: #3B82F6;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.custom-input-group .input-group-text {
    background-color: transparent;
    border: none;
    color: #6c757d;
    font-size: 1.1rem;
    padding-left: 1rem;
}

.custom-input-group .form-control {
    background-color: transparent;
    border: none;
    color: #212529;
    /* Dark text */
    padding: 0.75rem 1rem;
    font-size: 1rem;
    box-shadow: none !important;
}

.custom-input-group .form-control::placeholder {
    color: #adb5bd;
}

/* Checkbox */
.login-form-container .form-check {
    display: flex;
    align-items: center;
    padding-left: 0 !important;
    margin-left: 0 !important;
    /* Align with inputs above */
    margin-bottom: 1.5rem;
    /* Add some space below before button */
    min-height: auto;
    /* Reset bootstrap default */
}

.login-form-container .form-check .form-check-input {
    background-color: #fff;
    border: 1px solid #ced4da;
    /* Standard border */
    width: 1.1em;
    height: 1.1em;
    margin-top: 0;
    margin-left: 0.1em !important;
    /* Force reset */
    padding: 0 !important;
    /* Override global input padding */
    cursor: pointer;
    float: none;
    /* Reset bootstrap float */
    margin-right: 0.75rem;
}

.login-form-container .form-check .form-check-input:checked {
    background-color: #2563EB;
    border-color: #2563EB;
}

.login-form-container .form-check .form-check-input:checked[type=checkbox] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-label {
    color: #495057;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 0;
    /* Handled by input margin-right */
}

/* Links */
.forgot-password-link {
    color: #3B82F6;
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password-link:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

/* Primary Button */
.login-submit-btn {
    background-color: #2563EB;
    /* Blue */
    border: none;
    border-radius: 6px;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.login-submit-btn:hover {
    background-color: #1D4ED8;
}

/* Footer & Legal */
.form-footer {
    text-align: center;
    color: #6c757d;
    font-size: 0.75rem;
}

/* Desktop Styles */
@media (min-width: 992px) {
    .login-image-section {
        display: flex;
        /* Show image on large screens */
    }
}

/* Mobile/Tablet Styles (< 1000px) */
/* Unified layout: Text hidden, Logo centered, Form centered, Background Image specific adjustments */
@media (max-width: 1000px) {

    /* 1. Image & Background Handling */
    .login-image-section {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
    }

    .login-bg-image {
        opacity: 0.6;
        /* 60% opacity for image only */
    }

    /* 2. Hide all overlay content on mobile since we moved logo to form */
    .brand-content {
        display: none !important;
    }

    /* 3. Center Logo Layout */
    .brand-logo {
        justify-content: center;
        margin-bottom: 2rem;
        width: 100%;
    }

    .brand-content {
        width: 100%;
        display: flex;
        justify-content: center;
        /* Ensure overlay padding doesn't push it weirdly */
        max-width: 100%;
    }

    .image-overlay {
        padding: 4rem 2rem 2rem 2rem;
        /* Reduce padding */
        align-items: center;
    }

    /* 4. Form Layout */
    .login-form-section {
        background-color: transparent !important;
        z-index: 1;

        display: flex;
        flex-direction: column;
        align-items: center;
        /* Horizontally center cross-axis (width) */
        justify-content: center;
        /* Vertically center main-axis (height) */

        padding: 2rem;
        /* Balanced padding */
        padding-top: 120px;
        /* Push form down to clear logo */
        width: 100%;
        max-width: 100%;
        /* Override desktop max-width */
    }

    .login-form-container {
        /* Ensure card remains opaque */
        position: relative;
        z-index: 2;
        margin: 0 auto;
        /* Horizontally center block element */
        width: 100%;
        max-width: 450px;
        /* Ensure max-width applies */
    }
}

/* Password Reset Override */
#password-reset-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 1.5rem;
}