/* ============================================================================
   EVENLIO AUTH PAGES FIXES
   Critical fixes for authentication pages visibility and layout
   ============================================================================ */

/* Force visibility of all auth page elements */
body.tactile-futurism .account,
body.tactile-futurism .account-inner,
body.tactile-futurism .account-inner__right,
body.tactile-futurism .account-form-wrapper,
body.tactile-futurism .login-form,
body.tactile-futurism .form-field,
body.tactile-futurism .account-footer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure proper overflow behavior */
body.tactile-futurism .account {
    overflow: visible !important;
}

body.tactile-futurism .account-inner {
    overflow: visible !important;
}

body.tactile-futurism .account-inner__right {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* Fix for form elements */
.login-form {
    width: 100%;
}

.form-field {
    width: 100%;
    flex-direction: column;
}

/* Social login compatibility with partial structure */
.social-login {
    width: 100%;
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.social-login .text-center {
    width: 100%;
}

.social-login__btn {
    display: flex !important;
    width: 100%;
}

/* Captcha container fix */
.form-field:has(x-captcha) {
    display: block !important;
}

x-captcha,
[class*="captcha"] {
    display: block !important;
    width: 100%;
}

/* Button visibility */
.btn--terminal {
    display: block !important;
    width: 100%;
}

/* Footer visibility */
.account-footer {
    display: block !important;
    width: 100%;
}

.account-copyright {
    display: block !important;
    width: 100%;
}

/* Fix checkbox display */
.form-field__checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.5rem;
}

/* Ensure role selection is visible */
.role-selection {
    display: flex !important;
    width: 100%;
}

.role-selection__grid {
    display: grid !important;
    width: 100%;
}

/* Fix for any hidden inputs or fields */
.form-field input:not([type="hidden"]),
.form-field select,
.form-field textarea {
    display: block !important;
    visibility: visible !important;
}

/* Ensure labels are visible */
.form-field__label {
    display: block !important;
    visibility: visible !important;
}

/* Fix for password toggle button - CRITICAL */
.password-toggle {
    display: flex !important;
    visibility: visible !important;
    position: absolute !important;
    right: 0.5rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.password-toggle:hover {
    opacity: 0.7;
}

.password-toggle:active {
    opacity: 0.5;
}

.password-toggle i,
.password-toggle .fa,
.password-toggle .fas,
.password-toggle .far {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* Ensure input wrapper doesn't block clicks */
.form-field__input-wrapper {
    position: relative !important;
    pointer-events: auto !important;
}

/* Ensure input doesn't block the toggle button */
.form-field__input {
    pointer-events: auto !important;
}

/* Prevent any overlay from blocking the button */
.form-field__input-wrapper::before,
.form-field__input-wrapper::after {
    pointer-events: none !important;
}

/* Ensure input wrapper is positioned relative for absolute positioning of toggle */
.form-field__input-wrapper {
    position: relative !important;
}

/* Ensure proper padding for password inputs */
.form-field__input-wrapper:has(.password-toggle) .form-field__input {
    padding-right: 3rem !important;
}

.form-field__input-wrapper:not(:has(.password-toggle)) .form-field__input {
    padding-right: 1rem !important;
}

/* Responsive height fixes */
@media (max-width: 1023px) {
    body.tactile-futurism .account,
    body.tactile-futurism .account-inner {
        height: auto !important;
        min-height: 100vh !important;
    }
    
    body.tactile-futurism .account-inner__right {
        height: auto !important;
        min-height: 100vh !important;
    }
}

/* Mobile specific fixes */
@media (max-width: 767px) {
    .account-form-wrapper {
        padding-bottom: 2rem;
    }
    
    .account-copyright {
        padding-bottom: 1.5rem;
    }
    
    .password-toggle {
        right: 0.5rem !important;
        width: 2.25rem !important;
        height: 2.25rem !important;
    }
    
    .password-toggle i {
        font-size: 1rem !important;
    }
    
    .form-field__input-wrapper:has(.password-toggle) .form-field__input {
        padding-right: 2.75rem !important;
    }
}

@media (max-width: 479px) {
    .password-toggle {
        right: 0.5rem !important;
        width: 2rem !important;
        height: 2rem !important;
    }
    
    .password-toggle i {
        font-size: 0.9375rem !important;
    }
    
    .form-field__input-wrapper:has(.password-toggle) .form-field__input {
        padding-right: 2.5rem !important;
    }
}

/* Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

body.tactile-futurism {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Fix for any position absolute elements that might be hidden */
.account-inner__right .position-relative {
    position: relative !important;
}

/* Ensure all children of form wrapper are visible */
.account-form-wrapper > * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for social login title */
.social-login__title {
    display: block !important;
    text-align: center;
    width: 100%;
}
