/* ========================================
   KasGowin Financial - Modern Login Page
   Bootstrap 5 Compatible
   Clean & Professional Design
   FIXED: Icon visibility issue
   ======================================== */

/* === Root Variables === */
:root {
    /* Primary Colors from Logo */
    --primary-blue: #2a2a96;
    --primary-dark: #2B7DE9;
    --accent-yellow: #FFD700;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --gray: #6C757D;
    --dark-gray: #343A40;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    
    /* Background Colors */
    --bg-primary: #1172f6;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    
    /* Status Colors */
    --success: #22C55E;
    --error: #EF4444;
    --warning: #F59E0B;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === Global Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Main Auth Container === */
#auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
}

#auth .container-fluid {
    padding: 0;
}

#auth .row {
    margin: 0;
}

/* === Left Side - Image Section === */
#auth-right {
    height: 100%;
    position: relative;
    background-image: url('/app/assets/static/images/bg/bg-login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#auth-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(13 114 246 / 58%);
    /* backdrop-filter: blur(4px); */
}

/* Decorative Elements */
#auth-right::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 50%;
    top: -150px;
    right: -150px;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-30px, 30px) rotate(90deg); }
    50% { transform: translate(0, 50px) rotate(180deg); }
    75% { transform: translate(30px, 30px) rotate(270deg); }
}

/* === Right Side - Login Form Section === */
.wrapper-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-white);
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    animation: fadeInUp 0.6s ease-out;
}

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

/* === Logo Section === */
/* === Enhanced Logo Section === */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(43, 125, 233, 0.05) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.logo-wrapper:hover {
    background: linear-gradient(135deg, rgba(43, 125, 233, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(43, 125, 233, 0.15);
}

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.logo-wrapper:hover .logo-img {
    transform: scale(1.05) rotate(2deg);
}

.logo-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    line-height: 1.2;
}

/* === Header Section === */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* === Alert Styles === */
.alert-custom {
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    animation: slideDown 0.4s ease-out;
}

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

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

/* === Form Styles === */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Input Group - FIXED z-index layering */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Icon - Higher z-index to stay on top */
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 18px;
    pointer-events: none;
    z-index: 10;
    transition: color var(--transition-fast);
}

/* Input Fields */
.form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--light-gray);
    border: 2px solid transparent;
    border-radius: var(--radius-md) !important;
    outline: none;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-control:hover {
    background-color: #E9ECEF;
}

.form-control:focus {
    background-color: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(43, 125, 233, 0.1);
}

/* Icon color change on focus - using sibling selector */
.input-group:focus-within .input-icon {
    color: var(--primary-blue);
}

.form-control.is-invalid {
    border-color: var(--error);
    background-color: rgba(239, 68, 68, 0.05);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.bi{
    width: unset;
    height: unset;
}
.btn i, .btn svg {
    width: unset;
    height: unset;
}

/* Password Toggle Button - Higher z-index */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: var(--gray);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    z-index: 10;
}

.btn-toggle-password:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

.btn-toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

/* === Captcha Styles === */
.captcha-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.captcha-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.captcha-img {
    width: 180px;
    height: 48px;
    border-radius: var(--radius-md);
    border: 2px solid #DEE2E6;
    background-color: var(--white);
    object-fit: cover;
}

.btn-reload-captcha {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-reload-captcha:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    transform: rotate(180deg);
}

.btn-reload-captcha:active {
    transform: rotate(180deg) scale(0.95);
}

.btn-reload-captcha i {
    font-size: 20px;
}

.captcha-input {
    flex: 1;
}

.captcha-input .form-control {
    padding-left: 16px;
}

/* === Form Options === */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #DEE2E6;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.form-check-label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* === Submit Button === */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background-color: var(--primary-blue);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.btn-login:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-login i {
    font-size: 18px;
    transition: transform var(--transition-normal);
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* Button Loading State */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Error Messages === */
.invalid-feedback {
    display: block;
    font-size: 13px;
    color: var(--error);
    margin-top: 6px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* === Footer === */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E9ECEF;
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.footer-link {
    color: var(--accent-yellow);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: #E5BE00;
}

/* === Responsive Design === */

/* Large Desktops */
@media (min-width: 1400px) {
    .auth-container {
        max-width: 500px;
    }
    
    .logo-img {
        height: 90px;
    }
    
    .auth-title {
        font-size: 32px;
    }
}

/* Tablets */
@media (max-width: 991.9px) {
    #auth-right {
        height: 300px;
    }
    
    .wrapper-login {
        min-height: calc(100vh - 300px);
    }
}

/* Mobile Landscape */
@media (max-width: 767.9px) {
    #auth-right {
        display: none;
    }
    
    .wrapper-login {
        min-height: 100vh;
        padding: 30px 20px;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .logo-img {
        height: 70px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-subtitle {
        font-size: 15px;
    }
}

/* Small Mobile */
@media (max-width: 575.9px) {


    .logo-wrapper {
        gap: 12px;
        padding: 10px 16px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .logo-title {
        font-size: 20px;
    }
    
    .logo-subtitle {
        font-size: 12px;
    }

    .wrapper-login {
        padding: 24px 16px;
    }
    
    .auth-container {
        padding: 0;
    }
    
    .logo-img {
        height: 60px;
    }
    
    .auth-header {
        margin-bottom: 24px;
    }
    
    .auth-title {
        font-size: 22px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        padding: 12px 14px 12px 44px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 14px;
        font-size: 16px;
    }
    
    .btn-login {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    /* Captcha Responsive */
    .captcha-wrapper {
        flex-direction: column;
    }
    
    .captcha-display {
        width: 100%;
    }
    
    .captcha-img {
        flex: 1;
        width: 100%;
        max-width: 200px;
    }
    
    .captcha-input {
        width: 100%;
    }
    
    /* Form Options */
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* === Accessibility === */
*:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    #auth-right {
        display: none;
    }
    
    .wrapper-login {
        min-height: auto;
    }
}

/* === Smooth Scrolling === */
html {
    scroll-behavior: smooth;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}