/* ==========================================
   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-container label > i {
    font-size: 14px;
    color: inherit;
}

.input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-container input {
    width: 100%;
    color: #0B0427;
    font-size: 18px;
    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;
    color: #46494F;
    font-size: 12px;
    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 {
    color: #000;
}

.input-container input::placeholder {
    color: #46494F;
    opacity: 0.5;
    font-size: 14px;
}

/* Inline field validation errors */
.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d92d20;
    font-size: 13px;
    line-height: 1.3;
    margin-top: 4px;
}

.field-error:empty {
    display: none;
}

.field-error i {
    font-size: 14px;
    flex-shrink: 0;
}

.input-container.is-invalid input {
    border-bottom-color: #d92d20 !important;
}

.toggle-row.is-invalid .checkbox-custom {
    border-color: #d92d20;
}

/* Date input: lighten empty-state format text, hide native picker icon, overlay FA icon */
.input-container input[type="date"]::-webkit-datetime-edit,
.input-container input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.input-container input[type="date"]::-webkit-datetime-edit-day-field,
.input-container input[type="date"]::-webkit-datetime-edit-month-field,
.input-container input[type="date"]::-webkit-datetime-edit-year-field,
.input-container input[type="date"]::-webkit-datetime-edit-text {
    color: #9CA3AF;
    font-weight: 500;
}

.input-container input[type="date"].has-value::-webkit-datetime-edit,
.input-container input[type="date"].has-value::-webkit-datetime-edit-fields-wrapper,
.input-container input[type="date"].has-value::-webkit-datetime-edit-day-field,
.input-container input[type="date"].has-value::-webkit-datetime-edit-month-field,
.input-container input[type="date"].has-value::-webkit-datetime-edit-year-field,
.input-container input[type="date"].has-value::-webkit-datetime-edit-text {
    color: #0B0427;
    font-weight: 600;
}

.input-container input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    cursor: pointer;
}

.input-container .date-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #46494F;
    font-size: 14px;
    pointer-events: none;
}

.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: 24px 40px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 8px;
    background: #FFF;
    margin: 20px auto 20px auto;
}

/* Wider variant for multi-column forms (e.g. complete_registration) */
.login-container--wide {
    width: 720px;
}

@media (max-width: 768px) {
    .login-container,
    .login-container--wide {
        width: auto;
        max-width: calc(100vw - 32px);
        padding: 20px 24px;
        margin: 4px auto 20px auto;
        box-sizing: border-box;
    }
}

.login-title {
    color: #0B0427;
    font-size: 30px;
    font-style: normal;
    font-weight: 700;
    line-height: 30px;
    margin-bottom: 16px;
}

@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: 24px;
    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;
    }
}

/* ==========================================
   Complete Registration: Gender Pill Buttons
   ========================================== */
.gender-group {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    width: 100%;
    padding: 4px 0 0 0;
}

.gender-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-height: 36px;
    padding: 6px 12px;
    background: #fff;
    border: 2px solid #DADADA;
    border-radius: 8px;
    color: #46494F;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.gender-btn:hover {
    border-color: #2020B3;
}

.gender-btn.active {
    border-color: #2020B3;
    color: #2020B3;
}

.gender-btn i {
    font-size: 16px;
}

/* ==========================================
   Complete Registration: Consent Rows
   ========================================== */
.toggle-row {
    width: 100%;
    margin-top: 16px;
}

.toggle-row .checkbox-container {
    justify-content: flex-start;
}

.toggle-row .checkbox-label a {
    color: inherit;
    text-decoration: underline;
}

/* ==========================================
   Complete Registration: Layout
   ========================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    column-gap: 40px;
    row-gap: 0;
    width: 100%;
}

.form-grid .input-container {
    min-width: 0;
    padding: 12px 0 4px 0;
    gap: 6px;
}

.form-grid .input-container input {
    padding: 4px 30px;
    line-height: 20px;
    text-align: start;
}
