/* ==========================================
   PROFESSIONAL LOGIN PAGE - BANK SUMUT e-DOC
   Clean, Corporate Banking Design
   ========================================== */

:root {
    --primary: #003d79;
    --primary-light: #0056a8;
    --primary-lighter: #e8f0fe;
    --accent: #c8a84e;
    --accent-light: #f5ecd4;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8e8ea0;
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --border: #e1e4e8;
    --border-focus: #003d79;
    --danger: #dc3545;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-input: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-btn: 0 4px 14px rgba(0, 61, 121, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #003d79 0%, #0056a8 35%, #1a6fcc 55%, #d4842a 80%, #e8943c 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   BACKGROUND DECORATION
   ========================================== */

.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}

.bg-circle-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 61, 121, 0.06) 0%, transparent 70%);
    top: -200px;
    right: -150px;
}

.bg-circle-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(200, 168, 78, 0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.bg-circle-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 61, 121, 0.04) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================================
   LOGIN PAGE LAYOUT
   ========================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* ==========================================
   LOGIN CARD
   ========================================== */

.login-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 40px 36px 32px;
    animation: cardFadeIn 0.5s ease-out;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

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

/* ==========================================
   HEADER SECTION
   ========================================== */

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrapper {
    margin-bottom: 16px;
}

.logo-img {
    max-width: 200px;
    height: auto;
    display: inline-block;
}

.header-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 0 auto 16px;
    border-radius: 2px;
}

.app-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.app-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0;
}

/* ==========================================
   FORM STYLES
   ========================================== */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-floating-group {
    position: relative;
}

.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.field-label i {
    color: var(--primary);
    font-size: 11px;
}

/* ==========================================
   INPUT WRAPPER
   ========================================== */

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fafbfc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--border-focus);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 61, 121, 0.08);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.form-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 11px 14px 11px 0;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    font-weight: 500;
}

.form-input::placeholder {
    color: #b8bcc4;
    font-weight: 400;
}

.form-input.is-invalid {
    color: var(--danger);
}

/* ==========================================
   TOGGLE PASSWORD
   ========================================== */

.toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.toggle-password:hover {
    color: var(--primary);
    background: var(--primary-lighter);
}

/* ==========================================
   CAPTCHA SECTION
   ========================================== */

.captcha-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.captcha-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafbfc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 8px 8px 12px;
    min-height: 56px;
}

.captcha-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-image img {
    max-width: 100%;
    max-height: 48px;
    border-radius: 4px;
}

.captcha-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-lighter);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    flex-shrink: 0;
}

.captcha-refresh:hover {
    background: var(--primary);
    color: #fff;
    transform: rotate(180deg);
}

/* ==========================================
   LOGIN BUTTON
   ========================================== */

.btn-login {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-btn);
    letter-spacing: 0.2px;
    margin-top: 4px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 61, 121, 0.35);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

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

/* ==========================================
   FOOTER SECTION
   ========================================== */

.login-footer {
    text-align: center;
    margin-top: 4px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.footer-link {
    font-size: 12.5px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.footer-divider {
    color: var(--border);
    font-size: 12px;
}

.footer-compress {
    margin-top: 4px;
}

.compress-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.compress-link:hover {
    color: #b08f3a;
    text-decoration: underline;
}

/* ==========================================
   COPYRIGHT
   ========================================== */

.login-copyright {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-copyright p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}

/* ==========================================
   ALERTS
   ========================================== */

.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 3px solid var(--danger);
}

.alert ul {
    padding-left: 16px;
}

.btn-close {
    font-size: 10px;
}

/* ==========================================
   VALIDATION FEEDBACK
   ========================================== */

.invalid-feedback {
    display: none;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    padding-left: 2px;
}

.was-validated .form-input:invalid ~ .invalid-feedback,
.form-input.is-invalid ~ .invalid-feedback,
.is-invalid + .invalid-feedback,
.form-floating-group.is-invalid .invalid-feedback {
    display: block;
}

.was-validated .input-wrapper:has(.form-input:invalid),
.input-wrapper:has(.form-input.is-invalid) {
    border-color: var(--danger);
}

/* ==========================================
   UTILITIES
   ========================================== */

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 576px) {
    .login-page {
        padding: 16px;
    }
    
    .login-card {
        padding: 28px 24px 24px;
        border-radius: var(--radius-md);
    }
    
    .logo-img {
        max-width: 160px;
    }
    
    .app-title {
        font-size: 19px;
    }
    
    .login-form {
        gap: 16px;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 24px 20px 20px;
    }
    
    .logo-img {
        max-width: 140px;
    }
    
    .app-title {
        font-size: 17px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-input:focus-visible {
    outline: none;
}

/* ==========================================
   MODAL OVERRIDE
   ========================================== */

.modal.fade .modal-dialog {
    animation: slideInDown 0.4s ease-out;
}

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