/* =========================================================================
   AUTH REFRESH — modern login page
   Overrides the "login100" template classes used in auth/login.blade.php,
   loaded via layouts/etemplate.blade.php after the legacy CSS.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* =========================================================================
   BASE RESET
   ========================================================================= */
html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background: #f4f5f8 !important;
    min-height: 100vh;
}

/* =========================================================================
   LAYOUT CONTAINERS
   ========================================================================= */
.limiter {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.container-login100 {
    height: 100vh !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Background overlay for better text contrast */
.container-login100::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

/* =========================================================================
   LOGIN CARD - FIXED FOR NO SHAKING
   ========================================================================= */
.wrap-login100 {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 40px 36px 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    /* Remove max-height and overflow to prevent scrollbar issues */
    max-height: none;
    overflow: visible;
    animation: fadeInUp 0.5s ease;
    /* Ensure content doesn't cause layout shifts */
    will-change: transform, opacity;
}

/* Remove scrollbar hiding (not needed anymore) */
.wrap-login100::-webkit-scrollbar {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   FORM - FIXED VERTICAL SPACING
   ========================================================================= */
.login100-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    /* Prevent any overflow */
    overflow: visible;
}

/* =========================================================================
   LOGO
   ========================================================================= */
.login100-form-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.login100-form-logo img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.15);
}

/* =========================================================================
   TITLE
   ========================================================================= */
.login100-form-title {
    text-align: center;
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #1f2430;
    margin-bottom: 24px !important;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

/* =========================================================================
   LABEL ROW (for forgot password)
   ========================================================================= */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.label-input100 {
    font-size: 13px;
    font-weight: 600;
    color: #344054;
    display: block;
}

.forgot-link {
    font-size: 12px;
    color: #4338ca;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.forgot-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* =========================================================================
   INPUT WRAPPER - FLEX-BASED (NO ABSOLUTE POSITIONING)
   ========================================================================= */
.wrap-input100 {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    border: 2px solid #e7e9ee;
    border-radius: 12px;
    background: #ffffff;
    padding: 0 14px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #4338ca;
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.08);
}

.input-icon {
    position: static;
    transform: none;
    flex-shrink: 0;
    margin-right: 10px;
    color: #98a2b3;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper:focus-within .input-icon {
    color: #4338ca;
}

.input100 {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    font-size: 14px;
    color: #1f2430;
    box-sizing: border-box;
}

.input100::placeholder {
    color: #98a2b3;
    font-weight: 400;
}

.input100:-webkit-autofill,
.input100:-webkit-autofill:hover,
.input100:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1f2430 !important;
}

/* =========================================================================
   PASSWORD TOGGLE
   ========================================================================= */
.password-wrapper .toggle-password {
    flex-shrink: 0;
    margin-left: 8px;
    background: none;
    border: none;
    color: #98a2b3;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.password-wrapper .toggle-password:hover {
    color: #4338ca;
}

.password-wrapper .toggle-password:focus {
    outline: none;
}

/* =========================================================================
   ERROR MESSAGES - FIXED HEIGHT TO PREVENT SHAKING
   ========================================================================= */
.wrap-input100 span[role="alert"] {
    display: block;
    min-height: 20px; /* Reserve space for error messages */
    margin-top: 4px;
    font-size: 12px;
    color: #f04438;
    font-weight: 500;
    animation: slideDown 0.2s ease;
}

.wrap-input100 span[role="alert"] i {
    margin-right: 4px;
    font-size: 11px;
}

.wrap-input100 span[role="alert"] strong {
    font-weight: 500 !important;
    color: #f04438 !important;
}

/* Empty error state - keep space reserved */
.wrap-input100 span[role="alert"]:empty {
    display: block;
    min-height: 20px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   CHECKBOX
   ========================================================================= */
.contact100-form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 4px;
    flex-shrink: 0;
}

.contact100-form-checkbox .input-checkbox100 {
    width: 18px;
    height: 18px;
    accent-color: #4338ca;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.contact100-form-checkbox .input-checkbox100:hover {
    transform: scale(1.05);
}

.label-checkbox100 {
    font-size: 13.5px;
    color: #667085;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.label-checkbox100:hover {
    color: #4338ca;
}

/* =========================================================================
   LOGIN BUTTON
   ========================================================================= */
.container-login100-form-btn {
    width: 100%;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.login100-form-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4338ca, #3730a3);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login100-form-btn i {
    font-size: 14px;
}

.login100-form-btn::before {
    display: none !important;
    content: none !important;
}

.login100-form-btn:hover,
.login100-form-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.3);
    background: linear-gradient(135deg, #3730a3, #312e81);
    color: #fff;
    outline: none;
}

.login100-form-btn:active {
    transform: translateY(0px);
}

/* =========================================================================
   DEMO CREDENTIALS
   ========================================================================= */
.demo-credentials {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f8f9fc;
    border-radius: 12px;
    border: 1px solid #e7e9ee;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.demo-credentials:hover {
    border-color: #4338ca;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.05);
}

.demo-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #98a2b3;
    margin-bottom: 10px;
    text-align: center;
}

.demo-title i {
    margin-right: 4px;
}

.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.demo-item {
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e7e9ee;
    display: flex;
    flex-direction: column;
    gap: 1px;
    transition: all 0.2s ease;
}

.demo-item:hover {
    border-color: #4338ca;
    transform: translateY(-1px);
}

.demo-item.col-span-2 {
    grid-column: span 2;
}

.demo-role {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #98a2b3;
}

.demo-role i {
    margin-right: 3px;
    font-size: 9px;
}

.demo-item code {
    font-size: 11px;
    font-weight: 500;
    color: #1f2430;
    font-family: 'Inter', monospace;
    word-break: break-all;
}

/* =========================================================================
   RESET/FORGOT PASSWORD SPECIFIC STYLES
   ========================================================================= */
.reset-subtitle {
    text-align: center;
    font-size: 14px;
    color: #667085;
    margin-bottom: 24px;
    margin-top: -8px;
    font-weight: 400;
    flex-shrink: 0;
}

.password-requirements {
    margin-top: 6px;
    padding: 0 4px;
    min-height: 20px;
}

.password-requirements small {
    font-size: 12px;
    color: #667085;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.password-requirements small i {
    font-size: 13px;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e7e9ee;
    flex-shrink: 0;
}

.auth-link {
    color: #667085;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-link:hover {
    color: #4338ca;
}

.auth-link i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.auth-link:hover i {
    transform: translateX(-3px);
}

.input100:read-only {
    background: transparent;
    cursor: default;
    opacity: 0.8;
}

/* =========================================================================
   RESPONSIVE DESIGN
   ========================================================================= */
@media (max-height: 700px) {
    .wrap-login100 {
        padding: 24px 28px 20px;
    }
    
    .login100-form-logo img {
        width: 48px !important;
        height: 48px !important;
    }
    
    .login100-form-title {
        font-size: 20px;
        margin-bottom: 18px !important;
    }
    
    .wrap-input100 {
        margin-bottom: 12px;
    }
    
    .input-wrapper {
        height: 42px;
        padding: 0 12px;
    }
    
    .input100 {
        font-size: 13px;
    }
    
    .input-icon {
        font-size: 13px;
        margin-right: 8px;
    }
    
    .password-wrapper .toggle-password {
        font-size: 14px;
        margin-left: 6px;
    }
    
    .contact100-form-checkbox {
        margin-bottom: 14px;
    }
    
    .login100-form-btn {
        height: 42px;
        font-size: 14px;
    }
    
    .demo-credentials {
        margin-top: 12px;
        padding: 10px 12px;
    }
    
    .demo-grid {
        gap: 4px;
    }
    
    .demo-item {
        padding: 4px 8px;
    }
    
    .demo-item code {
        font-size: 10px;
    }
    
    .reset-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
        margin-top: -4px;
    }
    
    .auth-links {
        margin-top: 12px;
        padding-top: 12px;
    }
}

@media (max-width: 480px) {
    .wrap-login100 {
        padding: 28px 20px 24px;
        border-radius: 16px;
        max-width: 95%;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-item.col-span-2 {
        grid-column: span 1;
    }
}

/* =========================================================================
   LEGACY SUPPORT
   ========================================================================= */
.p-t-30 table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e7e9ee !important;
    font-size: 12.5px;
}

.p-t-30 thead th {
    background: #f4f5f8;
    color: #667085;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: .04em;
}

.p-t-30 td {
    color: #1f2430;
}