/* ==========================================
   LOGIN PAGE STYLES
   Combined CSS for login page (template-agnostic)
   ========================================== */

/* ==========================================
   Input Component Styles
   ========================================== */
.input-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 20px 0 8px 0;
}

.input-container label {
    color: #46494F;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-container input {
    width: 100%;
    color: #0B0427;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
    border: none;
    outline: none;
    background: transparent;
    border-bottom: 2px solid #2020B3;
    padding: 8px 30px;
}

.input-clear-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.input-clear-button.visible {
    opacity: 1;
    visibility: visible;
}

.input-clear-button:hover svg path {
    stroke: #000;
}

.input-container input::placeholder {
    color: #46494F;
    opacity: 0.5;
}

.error-message {
    color: #FF0000;
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
    line-height: 14px;
    margin-top: -12px;
}

.input-container label.icon::before {
    content: '';
    background: transparent url('') no-repeat center center;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-container label.user-icon::before {
    background-image: url('/assets/icons/user.svg');
}

/* ==========================================
   Checkbox Component Styles
   ========================================== */
.checkbox-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 18px;
    color: #46494F;
    text-align: right;
}

/* Custom Checkbox */
.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    position: relative;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid #DADADA;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Checkmark */
.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 50%;
    top: 45%;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Checked State */
.checkbox-input:checked+.checkbox-custom {
    background-color: #2020B3;
    border-color: #2020B3;
}

.checkbox-input:checked+.checkbox-custom::after {
    display: block;
}

/* Hover State */
.checkbox-container:hover .checkbox-custom {
    border-color: #2020B3;
}

/* Focus State */
.checkbox-input:focus+.checkbox-custom {
    outline: 2px solid rgba(32, 32, 179, 0.3);
    outline-offset: 2px;
}

/* Disabled State */
.checkbox-input:disabled+.checkbox-custom {
    background-color: #f5f5f5;
    border-color: #E8E8E8;
    cursor: not-allowed;
}

.checkbox-input:disabled~.checkbox-label {
    color: #999;
    cursor: not-allowed;
}

/* ==========================================
   Login Page Layout Styles
   ========================================== */
.login-container {
    display: flex;
    width: 500px;
    padding: 40px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 8px;
    background: #FFF;
    margin: 40px auto 100px auto;
}

@media (max-width: 768px) {
    .login-container {
        width: 100%;
        padding: 28px 24px;
        margin-top: 20px;
        margin-bottom: 50px;
    }
}

.login-title {
    color: #0B0427;
    font-size: 30px;
    font-style: normal;
    font-weight: 700;
    line-height: 30px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .login-title {
        padding-right: 0px;
        font-size: 26px;
        font-style: normal;
        font-weight: 600;
        margin-bottom: 12px;
    }
}

.tab-panel-title {
    color: #0B0427;
    font-size: 24px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .tab-panel-title {
        font-size: 22px;
        font-weight: 600;
        line-height: 20px;
        margin-bottom: 12px;
    }

    h2.tab-panel-title {
        padding: 0;
    }
}

.form-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 40px;
    width: 100%;
}

@media (max-width: 768px) {
    .form-container {
        gap: 12px;
    }
}

.form-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.inputs-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    gap: 0 40px;
}

.inputs-container .input-container {
    max-width: 420px;
    width: 100%;
}

.form-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 40px;
}

.form-signup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .form-signup-container {
        gap: 0px;
    }
}

.form-signup-container h3 {
    color: #46494F;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
}

.form-signup-container a {
    color: #2020B3;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    text-decoration: none;
}

.submit-button {
    display: flex;
    width: 100%;
    height: 50px;
    padding: 12px 16px;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
    border: 2px solid var(--ffffff, #FFF);
    background: var(--LEADBLUE, #2020B3);
    box-shadow: 0 2.286px 7.429px 0 rgba(0, 0, 0, 0.16);
    color: #FFF;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 34.286px;
    cursor: pointer;
}

.submit-button:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .submit-button {
        width: 100%;
    }
}


/* Error alerts - subtle inline panel; hidden by default, shown by loginFail() JS */
.form-alert {
    display: none;
    width: 100%;
    margin: 8px 0 0 0;
    padding: 10px 12px;
    background: rgba(220, 53, 69, 0.06);
    border-right: 3px solid #dc3545;
    border-radius: 4px;
    color: #dc3545;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: right;
}

.form-alert a {
    display: inline-block;
    margin-top: 4px;
    color: #dc3545;
    font-weight: 500;
    text-decoration: underline;
}

.form-alert a:hover {
    opacity: 0.85;
}

/* Utility: ensure .hidden works without Bootstrap */
.hidden,
.login-container.hidden {
    display: none !important;
}
/* ==========================================
   OTP Page Styles
   ========================================== */
.otp-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    width: 100%;
}

.otp-description {
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    color: #0B0427;
    text-align: center;
    width: 100%;
    margin: 0;
}

.otp-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    gap: 24px;
}

.otp-links .otp-link {
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    color: #2020B3;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
}

.otp-link:hover {
    opacity: 0.8;
}

/* OTP Timer */
.otp-timer {
    font-size: 16px;
    font-weight: 500;
    color: #46494F;
    text-align: center;
}

/* OTP Page Centering Overrides */
.otp-content .form-container {
    align-items: center;
}

.otp-content .form-body {
    align-items: center;
}

.otp-content .form-footer {
    align-items: center;
    gap: 24px;
}

.otp-content .inputs-container {
    justify-content: center;
}

/* OTP Digit Inputs */
.otp-inputs {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 12px 0;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #0B0427;
    border: none;
    outline: none;
    background: transparent;
    border-bottom: 2px solid #DADADA;
    padding: 0;
    transition: border-color 0.15s ease;
    /* hide number-input spin buttons */
    -moz-appearance: textfield;
    appearance: textfield;
}

.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-digit:focus,
.otp-digit.filled {
    border-bottom-color: #2020B3;
}

@media (max-width: 768px) {
    .otp-inputs {
        gap: 10px;
    }
    .otp-digit {
        width: 40px;
        height: 48px;
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .otp-description {
        font-size: 18px;
        line-height: 24px;
    }
    .otp-links {
        gap: 20px;
        flex-wrap: wrap;
    }
    .otp-link {
        font-size: 16px;
    }
}
