/**
 * Modern, minimal login page styles
 */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #212529;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* Ensure main content centers vertically on login page */
body.login-page main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Login container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    position: relative;
}

/* Login card */
.login-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid #e9ecef;
}

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

.brand-logo {
    margin-bottom: 24px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background-color: #6c757d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #ffffff;
    font-size: 20px;
}

.brand-title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 8px 0;
}

.brand-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* Form section */
.login-form-section {
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: #212529;
    margin: 0 0 8px 0;
}

.form-header p {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* Form styles */
.login-form {
    width: 100%;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.form-label i {
    margin-right: 8px;
    color: #6c757d;
    width: 16px;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #ffffff;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: #495057;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* Input styling for both NIP and OTP */
#nip, #otp {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 2px;
}

/* Password toggle removed - OTP is now always visible */

/* Form actions */
.form-actions {
    margin-top: 24px;
}

.btn-login {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    background-color: #495057;
    border: 1px solid #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background-color: #343a40;
    border-color: #343a40;
}

.btn-login:active {
    background-color: #212529;
    border-color: #212529;
}

.btn-login:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-text i {
    margin-right: 8px;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loading {
    display: flex;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error messages */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 6px;
    font-size: 12px;
    color: #dc3545;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Help section */
.help-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.help-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6c757d;
}

.help-item i {
    margin-right: 8px;
    width: 16px;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.login-footer p {
    margin: 0;
    font-size: 12px;
    color: #ffffff;
}

/* Responsive design */
@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .brand-title {
        font-size: 20px;
    }
    
    .form-header h2 {
        font-size: 18px;
    }
}

/* Focus states for accessibility */
.form-control:focus,
.btn-login:focus {
    outline: 2px solid #495057;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 2px;
    }
    
    .btn-login {
        border-width: 2px;
    }
}