/* Login Modal (Web) — international-standard styling aligned to site header */

/* Accessible utility */
.sr-only{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
}

/* Load Passion One font for modal headings (keeps file-scoped to this component) */
@font-face {
    font-family: 'Passion One';
    src: url('/webfonts/web/PassionOne-Regular.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.72);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.22s ease-out;
}

.modal-overlay.active { 
    display: flex; 
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

.login-modal {
    font-family: var(--default-font, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
    background-color: var(--white-color, #fff);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255,255,255,0.08);
    animation: slideUp 0.24s ease-out;
}

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

.modal-header {
    background: linear-gradient(315deg, var(--accent-color, #C42221) -3%, #153752 58.57%, var(--primary-color, #031521) 91.58%);
    padding: 0 16px 14px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-close { 
    position: absolute; 
    top: 2px;
    right: 2px;
    background: none; 
    border: none; 
    color: var(--white-color, #fff);
    font-size: 1.25rem;
    cursor: pointer; 
    width: 25px; 
    height: 25px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
    transform: translateY(-1px);
}

.modal-close:focus-visible{
    outline: 3px solid rgba(255, 215, 0, 0.55);
    outline-offset: 2px;
}

.modal-title { 
    color: var(--primary, #111); 
    font-size: 1.8rem; 
    margin-bottom: 5px; 
}

.modal-subtitle { 
    color: var(--light, #fff); 
    font-size: 0.9rem; 
    opacity: 0.9; 
}

.user-type-selector {
    display: flex;
    background-color: rgba(255,255,255,0.94);
    width: 100%;
    margin: 14px 0 0;
    border-radius: 12px;
    padding: 4px;
    position: relative;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.user-type-btn { 
    flex: 1; 
    padding: 14px; 
    text-align: center; 
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer; 
    transition: all 0.3s ease; 
    z-index: 2; 
    border-radius: 10px; 
    color: var(--primary-color, #031521);
    background: transparent; 
    border: none; 
}

.user-type-btn:focus-visible{
    outline: 3px solid rgba(196, 34, 33, 0.35);
    outline-offset: 2px;
}

.user-type-btn.active { 
    color: var(--text-dark, #111); 
}

.type-slider { 
    position: absolute; 
    top: 5px; 
    left: 5px; 
    width: calc(50% - 5px); 
    height: calc(100% - 10px); 
    background-color: rgba(196, 34, 33, 0.22);
    border: 1px solid rgba(196, 34, 33, 0.52);
    border-radius: 10px; 
    transition: transform 0.22s ease;
    box-shadow: 0 8px 18px rgba(3, 21, 33, 0.12);
}

.type-slider.right { 
    transform: translateX(100%); 
}

.login-form { 
    padding: 0 20px 20px;
}

/* Keep the form content centered by width while labels remain above inputs */
.login-form .form-title,
.login-form .form-error,
.login-form .modal-login-btn,
.login-form .instructions{
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.form-title { 
    color: var(--primary-color, #031521);
    /* Use Passion One from bundled webfonts for the modal title, fallback to accent/default fonts */
    font-family: 'Passion One';
    font-size: 2.0rem;
    margin-bottom: 10px;
    margin-top: 10px;
    text-align: center; 
    font-weight: 100;
}

.form-error{
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(196, 34, 33, 0.35);
    background: rgba(196, 34, 33, 0.08);
    color: #7a0b0b;
    font-size: 0.92rem;
    line-height: 1.35;
}

/* ==================== UPDATED CREDENTIALS CONTAINER STYLES ==================== */
.credentials-container{
    border: 1px solid rgba(3, 21, 33, 0.12);
    border-radius: 14px;
    padding: 20px 18px;
    background: rgba(3, 21, 33, 0.02);
    display: flex;
    flex-direction: column;
    gap: 20px; /* Space between User ID and Password sections */
    margin-bottom: 10px;
}

/* Input groups - each containing label + input */
.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Labels positioned above inputs */
.input-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--primary-color, #031521);
    line-height: 1.4;
}

/* Label icons */
.label-icon {
    margin-right: 10px;
    color: rgba(3, 21, 33, 0.70);
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

/* Input field containers - ensure equal width */
.input-field-container {
    width: 100%;
    position: relative;
}

/* Password container specific */
.password-container {
    position: relative;
    width: 100%;
}

/* Input fields - ensure equal width and alignment */
.input-field, .login-input-field {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid rgba(3, 21, 33, 0.20);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    background-color: rgba(255,255,255,0.98);
    color: var(--primary-color, #031521);
    box-sizing: border-box;
}
.fa-user,
.fa-user-shield,
.fa-sign-in-alt {
    padding-right: 10px;
}

.input-field:focus, .login-input-field:focus {
    outline: none;
    border-color: rgba(196, 34, 33, 0.65);
    box-shadow: 0 0 0 4px rgba(196, 34, 33, 0.14);
}

.input-field::placeholder, .login-input-field::placeholder {
    color: rgba(3, 21, 33, 0.45);
}

/* Password toggle button */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(3, 21, 33, 0.70);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.toggle-password:hover {
    background-color: rgba(3, 21, 33, 0.05);
}

.toggle-password:focus-visible {
    outline: 3px solid rgba(196, 34, 33, 0.35);
    outline-offset: 2px;
    border-radius: 10px;
}

/* Login button */
.modal-login-btn {
    width: 100%;
    max-width: 420px;
    padding: 16px;
    background: linear-gradient(315deg, var(--accent-color, #C42221) 0%, #153752 70%, var(--primary-color, #031521) 100%);
    color: var(--white-color, #fff);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    letter-spacing: 0.02em;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.modal-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(3, 21, 33, 0.22);
}

.modal-login-btn:focus-visible {
    outline: 4px solid rgba(255, 215, 0, 0.55);
    outline-offset: 2px;
}

.modal-login-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

.instructions {
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(3, 21, 33, 0.04);
    border-radius: 10px;
    border-left: 4px solid var(--accent-color, #C42221);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.instructions p {
    color: rgba(3, 21, 33, 0.80);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.instructions strong {
    color: var(--accent-color, #C42221);
}


/* ==================== DARK MODE UPDATES ==================== */
body.dark .login-modal,
body.dark-mode .login-modal {
    background-color: #0f1113;
    border-color: rgba(255,255,255,0.10);
}

body.dark .form-title,
body.dark-mode .form-title {
    color: #f3f4f6;
}

body.dark .credentials-container,
body.dark-mode .credentials-container {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}

body.dark .input-label,
body.dark-mode .input-label {
    color: #e5e7eb;
}

body.dark .label-icon,
body.dark-mode .label-icon {
    color: rgba(243, 244, 246, 0.8);
}

body.dark .input-field,
body.dark-mode .input-field,
body.dark .login-input-field,
body.dark-mode .login-input-field {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.16);
    color: #f3f4f6;
}

body.dark .input-field::placeholder,
body.dark-mode .input-field::placeholder,
body.dark .login-input-field::placeholder,
body.dark-mode .login-input-field::placeholder {
    color: rgba(243,244,246,0.55);
}

body.dark .toggle-password:hover,
body.dark-mode .toggle-password:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark .instructions,
body.dark-mode .instructions {
    background: rgba(255,255,255,0.05);
}

body.dark .instructions p,
body.dark-mode .instructions p {
    color: rgba(243,244,246,0.78);
}

body.dark .form-error,
body.dark-mode .form-error {
    color: #fecaca;
    border-color: rgba(239,68,68,0.35);
    background: rgba(239,68,68,0.10);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce){
    .modal-overlay,
    .login-modal,
    .type-slider{
        animation: none !important;
        transition: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-modal {
        max-width: 95%;
    }
    
    .credentials-container {
        padding: 16px 14px;
        gap: 16px;
    }
    
    .input-field, .login-input-field {
        padding: 10px 12px;
        min-height: 42px;
        font-size: 0.95rem;
    }
    
    .modal-login-btn {
        padding: 14px;
    }
}
