/* 
 * LOGIN PAGE STYLES 
 * Unified from style.css and login.css
 */

/* --- Base Layout (Moved from style.css) --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: var(--bg);
}

.login-card {
    width: min(980px, 96vw);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    display: grid;
    grid-template-columns: 0.8fr 1.025fr;
    min-height: 650px;
}

@media(max-width:960px) {
    .login-card {
        grid-template-columns: 1fr;
    }

    .login-card .image {
        display: none;
    }
}

.login-page .form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 38px;
    position: relative;
}

/* Container for Logo + Title + Form */
.login-page .form-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
}

.login-page .form-inner {
    width: 100%;
    max-width: 440px;
}

/* Typography & Inputs (Base) */
.login-page h1 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 1.5rem !important;
    /* Unified from login.css override */
    font-weight: 300 !important;
    /* Unified */
}

.login-page p {
    color: var(--muted);
    margin-bottom: 50px;
}

.login-page .field {
    position: relative;
    margin-bottom: 16px;
}

.login-page .field .icon-left {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
}

.login-page .field .icon-right {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--muted);
    display: flex;
}

.login-page input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    padding: 12px 40px;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-page input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.login-page .btn-login {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 16px;
    font-family: var(--font-body) !important;
}

.login-page .btn-login:hover {
    background: var(--primary-600);
}

.login-page .btn-login:active {
    transform: scale(0.98);
}

.login-page .row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* --- Refinements from login.css --- */

.login-page label.lbl {
    font-size: 0.6rem !important;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    display: block;
    text-transform: uppercase;
    color: var(--text);
    /* Ensure label color if needed */
}

.login-page .checkbox {
    font-size: 0.8rem !important;
    text-transform: none !important;
}

.login-page .checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.login-page a.small {
    font-size: 0.8rem !important;
}

.login-page .footer-note {
    font-size: 0.75rem !important;
    position: absolute;
    bottom: 2rem;
    opacity: 0.6;
    width: 100%;
    text-align: center;
    left: 0;
}

.txt-center {
    text-align: center !important;
    margin-bottom: 1rem;
}

/* Logo Styling (Unified) */
.login-page .logo {
    position: absolute;
    top: 2rem;
    left: 0;
    width: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-page .logo img {
    opacity: .95;
    display: block;
    margin-bottom: 4px;
}

.login-page .logo .brand-title {
    font-weight: 700;
    letter-spacing: .02em;
    font-size: 1.1rem;
    line-height: 1.2;
}

.login-page .logo .brand-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 400;
}

/* --- Extra Features (Preloader, Slideshow, Mobile) --- */

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#preloader img {
    height: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

/* Slideshow */
@keyframes k-zoomIn {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.login-page .image {
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 10s linear;
    transform-origin: center center;
    transform: scale(1);
}

.bg-slide.active {
    opacity: 0.92;
    transform: scale(1.1);
}

/* Quote overlay */
.login-page .quote {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 40px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 500;
    line-height: 1.4;
}

.login-page .quote .author {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
    font-style: normal;
}

/* Navigation Arrows (Desktop) */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
    border-radius: 4px;
    user-select: none;
}

.image:hover .nav-arrow {
    opacity: 1;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.nav-next {
    right: 10px;
}

/* Mobile Overlay & Sheet Modal behavior */
.mobile-cover-content {
    display: none;
}

.mobile-close-btn {
    display: none;
}

@media (max-width: 768px) {
    .nav-arrow {
        display: none !important;
    }

    /* Image becomes fullscreen background */
    .login-page .image {
        display: block !important;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        border-radius: 0;
        overflow: hidden;
        border: none;
    }

    /* Form becomes a Sheet Modal */
    .login-page .form {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        z-index: 30;
        transform: translateY(110%);
        transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
        padding-top: 2rem;
        padding-bottom: 2rem;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    body.mobile-login-active .form {
        transform: translateY(0);
    }

    body.mobile-login-active .image::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 5;
        transition: background 0.4s;
    }

    /* Mobile Cover Content */
    .mobile-cover-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        inset: 0;
        z-index: 25;
        padding: 2rem 1.5rem 3rem 1.5rem;
        /* Reduced top padding from 4rem to 2rem */
        text-align: center;
        color: #fff;
        background: rgba(0, 0, 0, 0.5);
        transition: opacity 0.3s;
    }

    body.mobile-login-active .mobile-cover-content {
        opacity: 0;
        pointer-events: none;
    }

    .mobile-cover-content h1 {
        font-size: 2rem;
        font-weight: 500;
        letter-spacing: 0.3em;
        text-transform: uppercase;
        margin-bottom: 0px;
        /* Removed margin */
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .mobile-cover-content img {
        height: auto;
        width: 70px !important;
        /* Slightly smaller logo */
        max-width: 100%;
        margin-bottom: 0.5rem;
        /* Reduced from 1rem */
        filter: none;
    }

    .mobile-cover-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0;
        /* Removed top margin */
        padding-top: 1rem;
        /* Small internal padding if needed */
    }

    .mobile-cover-mid {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0 1rem;
    }

    .mobile-cover-bottom {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 1rem;
    }

    .mobile-quote {
        font-style: italic;
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        opacity: 0.95;
    }

    .mobile-author {
        font-size: 0.9rem;
        opacity: 0.8;
        margin-top: 0.5rem;
        display: block;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-size: 0.8rem;
    }

    .mobile-cover-content p {
        font-size: 0.85rem;
        color: #fff;
        opacity: 1;
        margin-bottom: 0;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        text-transform: uppercase;
        /* Match screenshot */
        letter-spacing: 0.15em;
        /* Match screenshot */
        line-height: 1.6;
        max-width: 300px;
    }

    .btn-mobile-start {
        background: #22c55e;
        /* Bright green from screenshot */
        color: #fff;
        border: none;
        padding: 1rem;
        border-radius: 6px;
        font-size: 1rem;
        font-weight: 700;
        text-transform: uppercase;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        width: 100%;
        max-width: 100%;
        letter-spacing: 0.05em;
        font-family: var(--font-body);
    }



    .mobile-footer {
        position: absolute;
        bottom: 1.5rem;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.6);
        display: block;
    }

    /* Hide Logo/Brand in Mobile Form Sheet */
    .login-card .form .logo {
        display: none !important;
    }

    /* Prevent Pull-to-Refresh on the form sheet */
    .login-card .form {
        overscroll-behavior-y: contain;
        touch-action: pan-y;
    }

    /* Prevent body scroll when sheet is active */
    body.mobile-login-active {
        overflow: hidden;
        overscroll-behavior-y: none;
    }



    .mobile-close-btn {
        display: flex;
        position: absolute;
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 10px;
        cursor: pointer;
    }

    .quote {
        display: none !important;
    }

    .mobile-close-btn::before {
        content: '';
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: -20px;
        right: -20px;
    }
}


.login-page label.lbl {
    font-size: 0.6rem !important;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    /* Added spacing as requested */
    display: block;
}

.login-page .checkbox {
    font-size: 0.8rem !important;
    text-transform: none !important;
}

.login-page .checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.login-page a.small {
    font-size: 0.8rem !important;
}

.login-page .footer-note {
    font-size: 0.75rem !important;
    position: absolute;
    /* Absolute position to not affect centering */
    bottom: 2rem;
    opacity: 0.6;
    width: 100%;
    text-align: center;
    left: 0;
}

@media (max-width: 768px) {
    .login-page .footer-note {
        display: none !important;
    }
}

.txt-center {
    text-align: center !important;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.login-page .logo {
    position: absolute;
    top: 2rem;
    left: 0;
    width: 100%;
    margin-bottom: 0;
    /* Remove old margin */
    /* Maintain flex/center defined in style.css or override if needed */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#preloader img {
    height: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

/* Slideshow transitions */
@keyframes k-zoomIn {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.image {
    position: relative;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    /* Smooth transition for both opacity and transform to avoid snap back */
    transition: opacity 1.5s ease-in-out, transform 10s linear;
    transform-origin: center center;
    transform: scale(1);
    /* Base state */
}

.bg-slide.active {
    opacity: 0.92;
    transform: scale(1.1);
    /* End state for transition */
}

/* Navigation Arrows (Desktop) */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.3s, background 0.3s;
    border-radius: 4px;
    user-select: none;
}

.image:hover .nav-arrow {
    opacity: 1;
    /* Show on hover */
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.nav-next {
    right: 10px;
}

/* Mobile Overlay & Sheet Modal behavior */
.mobile-cover-content {
    display: none;
    /* Hidden on Desktop */
}

.mobile-close-btn {
    display: none;
}

@media (max-width: 768px) {
    .nav-arrow {
        display: none !important;
    }

    /* Image becomes fullscreen background */
    .login-page .image {
        display: block !important;
        /* Override theme's display:none */
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        border-radius: 0;
        overflow: hidden;
        border: none;
        /* Remove theme border */
    }

    /* Form becomes a Sheet Modal */
    .login-page .form {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        z-index: 30;
        transform: translateY(110%);
        /* Hidden initially */
        transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
        padding-top: 2rem;
        padding-bottom: 2rem;
        overflow-y: auto;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        background-color: var(--panel);
        border-top: 1px solid var(--border);
    }

    /* Active State: Show Form */
    body.mobile-login-active .form {
        transform: translateY(0);
    }

    /* Dim background when form is active */
    body.mobile-login-active .image::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 5;
        transition: background 0.4s;
    }

    /* Mobile Cover Content */
    /* Mobile Cover Content */
    .mobile-cover-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        /* Spread top/mid/bottom */
        position: fixed;
        /* Ensure valid fixed context */
        inset: 0;
        z-index: 25;
        /* Higher than img z-index 10 */
        padding: 3rem 2rem 3rem 2rem;
        text-align: center;
        color: #fff;
        background: rgba(0, 0, 0, 0.4);
        /* Darker overlay for text readability */
        transition: opacity 0.3s;
    }

    body.mobile-login-active .mobile-cover-content {
        opacity: 0;
        pointer-events: none;
    }

    .mobile-cover-content h1 {
        font-size: 2rem !important;
        font-weight: 600;
        letter-spacing: 6px;
        text-transform: uppercase;
        margin-bottom: 0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .mobile-cover-content img {
        height: auto;
        width: 80px !important;
        /* Strict constraint */
        max-width: 100%;
        margin-bottom: 1rem;
        filter: none;
        /* Show original colors */
    }

    .mobile-cover-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0;
    }

    .mobile-cover-mid {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0 1rem;
    }

    .mobile-cover-bottom {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 2rem;
    }

    .mobile-quote {
        font-style: italic;
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        opacity: 0.95;
    }

    .mobile-author {
        font-size: 0.9rem;
        opacity: 0.8;
        margin-top: 0.5rem;
        display: block;
    }

    .mobile-cover-content p {
        font-size: 1rem;
        margin-top: 10px;
        margin-bottom: 2rem;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        letter-spacing: 2px;
    }

    .btn-mobile-start {
        background: var(--primary);
        color: #fff;
        border: none;
        padding: 1rem 3rem;
        border-radius: 8px;
        /* Less rounded corners */
        font-size: 1rem;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        width: 100%;
        max-width: 300px;
    }

    /* Close Button on Form */
    .mobile-close-btn {
        display: flex;
        position: absolute;
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #ffffff85;
        border-radius: 10px;
        cursor: pointer;
    }

    /* Hide Desktop Quote on Mobile */
    .quote {
        display: none !important;
    }

    /* Hit area extension */
    .mobile-close-btn::before {
        content: '';
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: -20px;
        right: -20px;
    }
}

/* ── Register Page Overrides (Fix for Taller Form) ── */
.register-page .logo {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 1.5rem;
    margin-top: 0;
}

.register-page .footer-note {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 2rem;
    padding-bottom: 0;
}

.register-page .form {
    justify-content: flex-start;
    /* Align to top instead of center */
    height: 100%;
    overflow-y: auto;
    /* Internal scroll if needed */
}

.register-page .form-content-wrapper {
    margin-top: 0;
    margin-bottom: 0;
}

/* ── Specific Styles for Register Page ── */
.register-page .pwd-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: var(--border, #333);
    overflow: hidden;
}

.register-page .pwd-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width .4s, background .4s;
}

.register-page .link-login {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: .85rem;
    color: var(--text-muted, #9ca3af);
}

.register-page .link-login a {
    color: var(--primary, #6366f1);
    text-decoration: none;
}

.register-page .link-login a:hover {
    text-decoration: underline;
}

.register-page .success-box {
    text-align: center;
    padding: 2rem 1rem;
}

.register-page .success-box .check-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.register-page .success-box h2 {
    margin-bottom: .5rem;
}

.register-page .success-box p {
    color: var(--text-muted, #9ca3af);
    margin-bottom: 1.5rem;
}