/**
 * Authentication Layout - Enhanced UI/UX
 * Functional properties, breakpoints & JS hooks preserved
 */

/* =========================================
   1. Theme Variables
   ========================================= */
:root {
    /* Backgrounds & Surfaces */
    --auth-bg-light: #ffffff;
    --auth-bg-dark: #312d4b;
    --auth-surface-light: #ffffff;
    --auth-surface-dark: #3a3558;
    
    /* Borders & Focus */
    --auth-border-light: #e2e4ea;
    --auth-border-dark: #4a4560;
    --auth-primary: #696cff; /* Adjust to your brand */
    --auth-primary-hover: #5a5ee0;
    --auth-focus-ring: 0 0 0 3px rgba(105, 108, 255, 0.25);
    
    /* Text */
    --auth-text-light: #2b264b;
    --auth-text-dark: #e4e2f0;
    --auth-text-muted-light: #696a8a;
    --auth-text-muted-dark: #a19fbf;
    
    /* States */
    --auth-error: #ff4c51;
    --auth-radius: 12px;
    --auth-radius-sm: 8px;
    --auth-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    --auth-shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.1);
    
    /* Animations */
    --auth-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --auth-input-height: 56px;
}

/* =========================================
   2. Core Layout (Preserved Functionality)
   ========================================= */
.authentication-wrapper {
    display: flex;
    flex-basis: 100%;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: background-color var(--auth-transition);
}

.authentication-wrapper .authentication-inner {
    width: 100%;
    padding: 2rem;
    transition: var(--auth-transition);
}

.authentication-wrapper.authentication-basic {
    align-items: center;
    justify-content: center;
}

.authentication-wrapper.authentication-cover {
    align-items: flex-start;
}

.authentication-wrapper.authentication-cover .authentication-inner {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* =========================================
   3. Basic Auth Card
   ========================================= */
.authentication-wrapper.authentication-basic .authentication-inner {
    max-width: 460px;
    background: var(--auth-surface-light);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 2.5rem;
}

/* =========================================
   4. Decorative Images & Objects (Preserved Positioning)
   ========================================= */
.authentication-wrapper .auth-cover-illustration {
    z-index: 1;
    max-inline-size: 38rem;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.authentication-wrapper .authentication-image-object-left,
.authentication-wrapper .authentication-image-object-right {
    position: absolute;
    pointer-events: none;
    transition: transform var(--auth-transition);
}

.authentication-wrapper .authentication-image-object-left {
    bottom: 6%;
    inset-inline-start: 4%;
}

.authentication-wrapper .authentication-image-object-right {
    bottom: 7%;
    inset-inline-end: 4%;
}

.authentication-wrapper .authentication-image {
    z-index: -1;
    inline-size: 100%;
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    object-fit: cover;
    height: auto;
    max-height: 100vh;
}

.authentication-wrapper .authentication-image-model {
    width: 768px;
    max-width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.authentication-wrapper.authentication-cover .authentication-image-tree {
    position: absolute;
    bottom: 4rem;
    left: 3rem;
    z-index: 0;
}

html:not([dir=rtl]) .authentication-wrapper.authentication-cover .authentication-image {
    inset-inline-start: unset;
}

/* =========================================
   5. Auth Inputs (OTP/Verification Style)
   ========================================= */
.authentication-wrapper .auth-input-wrapper {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.authentication-wrapper .auth-input-wrapper .auth-input {
    max-width: 50px;
    width: 100%;
    height: var(--auth-input-height);
    padding-left: .4rem;
    padding-right: .4rem;
    font-size: 150%;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--auth-border-light);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-surface-light);
    color: var(--auth-text-light);
    transition: var(--auth-transition);
    outline: none;
    caret-color: var(--auth-primary);
}

.authentication-wrapper .auth-input-wrapper .auth-input:hover {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.1);
}

.authentication-wrapper .auth-input-wrapper .auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: var(--auth-focus-ring);
}

.authentication-wrapper .auth-input-wrapper .auth-input::placeholder {
    color: transparent;
}

/* =========================================
   6. Form Validation & Error States
   ========================================= */
#twoStepsForm .fv-plugins-bootstrap5-row-invalid .form-control {
    border-width: 2px;
    border-color: var(--auth-error);
    background-color: rgba(255, 76, 81, 0.05);
    animation: input-shake 0.4s ease-in-out;
}

@keyframes input-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* =========================================
   7. Light & Dark Mode Support
   ========================================= */
.light-style .authentication-wrapper .authentication-bg {
    background-color: var(--auth-bg-light);
}

.light-style .authentication-wrapper .authentication-inner,
.light-style .auth-input-wrapper .auth-input {
    background-color: var(--auth-surface-light);
    border-color: var(--auth-border-light);
    color: var(--auth-text-light);
}

.dark-style .authentication-wrapper .authentication-bg {
    background-color: var(--auth-bg-dark);
}

.dark-style .authentication-wrapper .authentication-inner {
    background-color: var(--auth-surface-dark);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.dark-style .auth-input-wrapper .auth-input {
    background-color: var(--auth-surface-dark);
    border-color: var(--auth-border-dark);
    color: var(--auth-text-dark);
}

.dark-style .auth-input-wrapper .auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.3);
}

.dark-style #twoStepsForm .fv-plugins-bootstrap5-row-invalid .form-control {
    background-color: rgba(255, 76, 81, 0.1);
}

/* =========================================
   8. RTL Support (Preserved & Enhanced)
   ========================================= */
[dir=rtl] .authentication-image-tree {
    right: 3rem;
    left: auto;
}

[dir=rtl] .authentication-wrapper .auth-input-wrapper {
    direction: rtl;
}

/* =========================================
   9. Responsive Breakpoints (Preserved Exactly)
   ========================================= */
@media(max-width: 575.98px) {
    .authentication-wrapper .auth-input-wrapper .auth-input {
        font-size: 1.125rem;
        height: 48px;
        max-width: 45px;
    }

    .numeral-mask-wrapper .numeral-mask {
        padding: 0 !important;
    }
    .numeral-mask:not(:focus) {
        margin-inline: 1px !important;
    }
    .numeral-mask:focus {
        margin-inline: auto !important;
    }

    .authentication-wrapper .authentication-inner {
        padding: 1.5rem;
    }
}

@media(max-width: 1199.98px) {
    .authentication-cover .authentication-image-model {
        position: relative;
        width: 575px;
        top: 1rem;
    }
}

/* =========================================
   10. Accessibility & Motion Preferences
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    .authentication-wrapper,
    .authentication-wrapper .authentication-inner,
    .auth-input-wrapper .auth-input,
    .authentication-image-model,
    .authentication-image-object-left,
    .authentication-image-object-right {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    #twoStepsForm .fv-plugins-bootstrap5-row-invalid .form-control {
        animation: none !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --auth-border-light: #000000;
        --auth-border-dark: #ffffff;
        --auth-focus-ring: 0 0 0 3px #000000;
    }

    .auth-input-wrapper .auth-input {
        border-width: 3px !important;
    }
}