/* ============================================
   BSI LOGIN PAGE - Modern & Clean Design
   All classes prefixed with 'bsi-' to avoid conflicts
   ============================================ */

/* Reset & Base Styles */
.bsi-login-page {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #ffeef8 0%, #e8f4f8 25%, #fff4e6 50%, #f0e8ff 75%, #ffeef8 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bsi-login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 182, 193, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(176, 224, 230, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(221, 160, 221, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bsi-login-page::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle, rgba(255, 182, 193, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: float 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

/* Wrapper & Container */
.bsi-login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.bsi-login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 2;
}

/* Login Card */
.bsi-login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    padding: 48px 40px;
    width: 100%;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.bsi-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffb6c1 0%, #b0e0e6 25%, #dda0dd 50%, #ffb6c1 75%, #b0e0e6 100%);
    background-size: 200% 100%;
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Header */
.bsi-login-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bsi-login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.bsi-logo-icon {
    width: 80px;
    height: 80px;
    background: transparent;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.bsi-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.bsi-logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.bsi-logo-icon i {
    font-size: 32px;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.bsi-login-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ff9faa 0%, #c8a2c8 50%, #87ceeb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bsi-login-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
}

/* Alert Messages */
.bsi-alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.4s ease;
}

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

.bsi-alert-error {
    background: linear-gradient(135deg, #ffb6c1 0%, #ff9faa 100%);
    color: #8b4a5c;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.3);
    border-left: 3px solid #ff9faa;
}

.bsi-alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Form Styles */
.bsi-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bsi-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bsi-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

/* Input Wrapper */
.bsi-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.bsi-input-icon {
    position: absolute;
    left: 16px;
    color: #c8a2c8;
    font-size: 1rem;
    z-index: 1;
    pointer-events: none;
    transition: color 0.3s ease;
}

.bsi-form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.bsi-form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.bsi-form-input:hover {
    border-color: #d1d5db;
    background: #fafafa;
}

.bsi-form-input:focus {
    border-color: #dda0dd;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(221, 160, 221, 0.15);
}

.bsi-form-input:focus + .bsi-input-icon,
.bsi-input-wrapper:focus-within .bsi-input-icon {
    color: #c8a2c8;
}

/* Password Wrapper */
.bsi-password-wrapper {
    position: relative;
}

.bsi-password-wrapper .bsi-form-input {
    padding-right: 48px;
}

.bsi-btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 2;
}

.bsi-btn-toggle-password:hover {
    color: #c8a2c8;
    background: rgba(221, 160, 221, 0.15);
}

.bsi-btn-toggle-password:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(221, 160, 221, 0.2);
}

.bsi-password-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 4px;
}

.bsi-password-hint i {
    font-size: 0.875rem;
    color: #c8a2c8;
}

/* Captcha Styles */
.bsi-captcha-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bsi-captcha-image-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bsi-captcha-image {
    flex: 1;
    height: 56px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.bsi-captcha-image:hover {
    border-color: #dda0dd;
    box-shadow: 0 0 0 4px rgba(221, 160, 221, 0.15);
}

.bsi-btn-refresh-captcha {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ffb6c1 0%, #dda0dd 50%, #b0e0e6 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.3);
    flex-shrink: 0;
}

.bsi-btn-refresh-captcha:hover {
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 182, 193, 0.4);
}

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

.bsi-btn-refresh-captcha i {
    font-size: 1rem;
}

.bsi-captcha-input {
    width: 100%;
}

/* Checkbox Styles */
.bsi-remember-group {
    margin-top: 4px;
}

.bsi-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: #374151;
}

.bsi-checkbox {
    display: none;
}

.bsi-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: #ffffff;
}

.bsi-checkbox:checked + .bsi-checkbox-custom {
    background: linear-gradient(135deg, #ffb6c1 0%, #dda0dd 100%);
    border-color: #dda0dd;
}

.bsi-checkbox:checked + .bsi-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
}

.bsi-checkbox-text {
    font-weight: 400;
    color: #374151;
}

.bsi-checkbox-label:hover .bsi-checkbox-custom {
    border-color: #dda0dd;
    box-shadow: 0 0 0 4px rgba(221, 160, 221, 0.15);
}

/* Login Button */
.bsi-btn-login {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ffb6c1 0%, #dda0dd 50%, #b0e0e6 100%);
    border: none;
    border-radius: 12px;
    color: #8b4a5c;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 182, 193, 0.3);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.bsi-btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.bsi-btn-login:hover::before {
    left: 100%;
}

.bsi-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 182, 193, 0.4);
    background: linear-gradient(135deg, #ffc0cb 0%, #e6b3e6 50%, #c0e0f0 100%);
}

.bsi-btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.3);
}

.bsi-btn-login:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(221, 160, 221, 0.25), 0 4px 16px rgba(255, 182, 193, 0.3);
}

.bsi-btn-login i {
    font-size: 1.1rem;
}

.bsi-btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Login Footer */
.bsi-login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.bsi-security-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 182, 193, 0.1);
    border-radius: 12px;
    border-left: 3px solid #ffb6c1;
}

.bsi-security-info i {
    font-size: 1.1rem;
    color: #c8a2c8;
    flex-shrink: 0;
    margin-top: 2px;
}

.bsi-security-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
}

.bsi-security-text strong {
    color: #374151;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 576px) {
    .bsi-login-card {
        padding: 36px 24px;
        border-radius: 20px;
    }
    
    .bsi-login-title {
        font-size: 1.75rem;
    }
    
    .bsi-logo-icon {
        width: 64px;
        height: 64px;
    }
    
    .bsi-logo-icon i {
        font-size: 28px;
    }
    
    .bsi-login-subtitle {
        font-size: 0.875rem;
    }
    
    .bsi-form-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .bsi-login-card {
        padding: 32px 20px;
    }
    
    .bsi-login-header {
        margin-bottom: 28px;
        padding-bottom: 24px;
    }
    
    .bsi-login-title {
        font-size: 1.5rem;
    }
}

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

.bsi-btn-login.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* Accessibility */
.bsi-form-input:focus-visible,
.bsi-btn-login:focus-visible,
.bsi-btn-toggle-password:focus-visible,
.bsi-btn-refresh-captcha:focus-visible {
    outline: 2px solid #dda0dd;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .bsi-login-page {
        background: #ffffff;
    }
    
    .bsi-login-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
