/* Login Page Styles */
/* Button loading states and animations */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .ph-spinner,
.ph-spinner.ph-spin,
i.ph-spinner.ph-spin {
    animation: spin 1s linear infinite !important;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn:disabled {
    cursor: not-allowed;
}

/* Smooth transition for button state changes */
.btn {
    transition: all 0.2s ease-in-out;
}

/* Login form specific styles */
.login-form {
    max-width: 400px;
    width: 100%;
    margin: 0 auto; /* Center the form */
    position: relative;
    overflow: visible; /* Allow card shadow to show */
    border: none !important; /* No border on form */
    padding: 0 !important; /* No padding on form */
    background: transparent !important; /* Transparent background */
}

/* Ensure form element itself doesn't interfere with card styling */
.login-form,
.login-form#loginForm {
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Input group styles for proper icon positioning */
.login-form .form-control-feedback {
    position: relative;
    display: block;
    width: 100%;
}

.login-form .form-control-feedback-start {
    position: relative;
    display: block;
    width: 100%;
}

.login-form .card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    border-radius: 0.75rem !important;
    background-color: #fff !important;
    height: auto !important; /* Override Bootstrap's card-height variable */
    min-height: auto !important;
    overflow: hidden !important; /* Ensure border-radius clips content */
    margin-bottom: 0 !important; /* Override Limitless default margin */
}

/* Ensure card-body respects the card's border-radius and doesn't create its own borders */
.login-form .card .card-body {
    border-radius: 0.75rem !important; /* Match parent card border-radius */
    padding: var(--card-spacer-y, 1.25rem) var(--card-spacer-x, 1.25rem) !important;
    border: none !important; /* Remove any borders */
    border-top: none !important; /* Ensure no top border */
    border-bottom: none !important; /* Ensure no bottom border */
    border-left: none !important;
    border-right: none !important;
}

.login-form .form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.login-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.login-form .form-control-feedback-icon {
    position: absolute !important;
    top: 50% !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    z-index: 5 !important;
    pointer-events: none !important;
    color: #6c757d !important;
    font-size: 1rem !important;
    display: block !important;
    padding: 0 !important;
    min-width: auto !important;
    align-items: unset !important;
}

.login-form .form-control-feedback-start .form-control {
    padding-left: 2.5rem;
    padding-right: 1rem;
}

/* Ensure icons are properly aligned */
.login-form .form-control-feedback-icon i {
    display: inline-block !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    font-size: 1rem !important;
}

/* Focus state for icons */
.login-form .form-control:focus + .form-control-feedback-icon {
    color: #0d6efd;
}

/* Hover state for icons */
.login-form .form-control:hover + .form-control-feedback-icon {
    color: #495057;
}

/* Override Limitless styles completely */
.login-form .form-control-feedback.form-control-feedback-start .form-control-feedback-icon {
    position: absolute !important;
    top: 50% !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    z-index: 5 !important;
    pointer-events: none !important;
    color: #6c757d !important;
    font-size: 1rem !important;
    display: block !important;
    padding: 0 !important;
    min-width: auto !important;
    align-items: unset !important;
    -ms-flex-align: unset !important;
    flex-direction: unset !important;
    -ms-flexbox: unset !important;
}

.login-form .form-control-feedback.form-control-feedback-start .form-control-feedback-icon i {
    display: inline-block !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    font-size: 1rem !important;
    min-width: 1em !important;
    font-family: Phosphor !important;
}

/* Alert styles */
.login-form .alert {
    border-radius: 0.5rem;
    border: none;
    padding: 0.75rem 1rem;
}

.login-form .alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.login-form .alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    border-left: 4px solid #198754;
}

/* Logo styles */
.login-form .h-48px {
    height: 48px;
    width: auto;
}

/* Footer styles */
.footer {
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.875rem;
}

.footer a {
    color: #0d6efd;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* reCAPTCHA error message container styles */
/* Ensure reCAPTCHA error messages are contained within the viewport */
.grecaptcha-badge,
.rc-anchor,
.rc-anchor-error-msg-container,
.rc-anchor-error-msg {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box !important;
}

/* Container for reCAPTCHA elements to prevent overflow - merged with main .login-form rule */

/* Ensure reCAPTCHA error messages are visible and contained */
.login-form .rc-anchor-error-msg-container {
    position: relative !important;
    max-width: 100% !important;
    margin: 0.5rem 0 !important;
    padding: 0.5rem !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid #dc3545 !important;
    border-radius: 0.5rem !important;
    color: #dc3545 !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box !important;
}

.login-form .rc-anchor-error-msg {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-align: left !important;
}

/* Additional container for reCAPTCHA errors that might appear outside */
body > .rc-anchor-error-msg-container,
body > .rc-anchor-error-msg {
    position: fixed !important;
    bottom: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 90% !important;
    width: auto !important;
    min-width: 300px !important;
    max-width: 500px !important;
    z-index: 10000 !important;
    padding: 0.75rem 1rem !important;
    background-color: rgba(220, 53, 69, 0.95) !important;
    border: 1px solid #dc3545 !important;
    border-radius: 0.5rem !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    box-sizing: border-box !important;
}

/* Ensure page content doesn't overflow */
.page-content {
    overflow-x: hidden;
    position: relative;
}

.content-wrapper {
    overflow-x: hidden;
    position: relative;
}

.content-inner {
    overflow-x: hidden;
    position: relative;
}

.content {
    overflow-x: hidden;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .login-form {
        margin: 1rem;
        max-width: none;
    }
    
    .login-form .card {
        margin: 0;
        border-radius: 0.5rem;
    }
    
    /* Adjust reCAPTCHA error message for mobile */
    body > .rc-anchor-error-msg-container,
    body > .rc-anchor-error-msg {
        max-width: calc(100% - 2rem) !important;
        min-width: auto !important;
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
    }
}
