html, body, main {
    height: 100%;
    margin: 0;
    line-height: normal !important;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.form-description {
    display: block;
    margin-top: 0.25rem;
    color: #6b6a7a !important;
    font-size: 14px !important;
    line-height: 20px;
}

.language-dropdown li:hover {
    background-color: rgba(0, 109, 192, 0.08);
}

.language-dropdown .dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #80bdff;
}

.dropdown-toggle::after {
    display: none;
}

.rounded-4 {
    border-radius: 12px;
}

/* Custom Button CSS */
.btn-custom {
    line-height: 1.75;
    font-size: 14px;
    border-radius: 8px;
    padding: 8px 16px;
    background-color: rgb(0, 109, 192);
    /* Bootstrap's higher-specificity .btn:first-child:active rule reads these; unset they render a transparent button. */
    --bs-btn-active-bg: rgb(0, 85, 150);
    --bs-btn-active-border-color: rgb(0, 85, 150);
    --bs-btn-active-color: #fff;
}

.btn-custom:hover {
    background-color: rgb(0, 95, 168);
}

.btn-custom:focus,
.btn-custom:active {
    background-color: rgb(0, 85, 150);
    border-color: rgb(0, 85, 150);
}

/* Disabled: clearly inactive but still legible (5.3:1 text), instead of a near-invisible 24% fade. */
.btn-custom:disabled,
.btn-custom.disabled {
    background-color: #d3dde7;
    border-color: #d3dde7;
    color: #4a5866 !important;
    opacity: 1;
    cursor: not-allowed;
}

.btn-custom:disabled img,
.btn-custom.disabled img {
    filter: brightness(0) invert(0.35);
}

/* External Provider Button CSS */
.btn-external {
    line-height: 1.75;
    font-size: 14px;
    border-radius: 8px;
    /* 1px shorter than .btn-custom to absorb the visible border, so both buttons are the same height. */
    padding: 7px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: transparent;
    border: 1px solid #7a8a99;
    color: #393939;
    --bs-btn-active-bg: rgba(0, 0, 0, 0.08);
    --bs-btn-active-border-color: #5f6f7e;
    --bs-btn-active-color: #393939;
}

.btn-external:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: #5f6f7e;
    color: #393939;
}

.btn-external:focus,
.btn-external:active {
    background-color: rgba(0, 0, 0, 0.08);
    border-color: #5f6f7e;
    color: #393939;
    outline: none;
    box-shadow: none;
}

.btn-external:disabled {
    background-color: #f1f4f7;
    border-color: #c3ccd5;
    color: #5f6b77;
    opacity: 1;
    cursor: not-allowed;
}

.btn-external svg {
    flex-shrink: 0;
}


/* Logo Styling */
.logo {
    width: 292px;
    height: 32px;
}

/* MDB Outline Field Replica CSS */

.form-outline {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-outline .form-control {
    border: 1px solid #7a8a99;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: transparent;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    height: 40px;
}

.form-outline .form-control:focus {
    border-color: rgb(0, 109, 192);

    outline: none;
}

.form-outline .form-label {
    position: absolute;
    top: -0.5rem;
    left: 0.75rem;
    background: white;
    padding: 0 0.25rem;
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    pointer-events: none;
    transform-origin: left center;
    transition: all 0.2s ease;
    transform: translateY(1.2rem);
    z-index: 1;
    line-height: 1;
}

/* Active state (focused or has content) */

.form-outline .form-control:focus {
    box-shadow: none;
}

.form-outline .form-control:focus + .form-label,
.form-outline .form-control:not(:placeholder-shown) + .form-label,
.form-outline .form-control.active + .form-label {
    transform: translateY(0) scale(0.85);
    color: rgb(0, 109, 192);
    font-weight: 500;
    box-shadow: none;
}

.form-outline .form-control:focus + .form-label {
    color: rgb(0, 109, 192);
    box-shadow: none;
}

/* Error state */

.form-outline .form-control.invalid {
    border-color: #dc3545;
}

.form-outline .form-control.invalid:focus {
    border-color: #dc3545;
    box-shadow: none;
}

.form-outline .form-control.invalid + .form-label,
.form-outline .form-control.invalid:focus + .form-label {
    color: #dc3545;
    box-shadow: none;
}

.form-outline .validation-message {
    color: #dc3545;
    text-align: start;
}

/* Textarea adjustments */

.form-outline textarea.form-control {
    padding: 0.5rem 0.75rem;
    min-height: 80px;
    resize: vertical;
    height: auto;
    line-height: 1.5;
}

/* Select adjustments */

.form-outline select.form-control {
    cursor: pointer;
}

.form-outline select.form-control:not([multiple]) {
    padding-right: 2rem;
}

/* Disabled state */

.form-outline .form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

.form-outline .form-control:disabled + .form-label {
    color: #6c757d;
}


/* Modal */
.modal-content {
    /*width: 412px;*/
    border-radius: 8px;
}

.modal-header {
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    font-size: 12px;
}

.modal-header {
    border-bottom: none;
}

.modal-footer {
    border-top: none;
    margin-bottom: 20px;

    /* Success-dialog confirm button: white text needs >= 4.5:1, so a darker green than #50cd89 (2:1). */
    .btn-custom {
        background: #1a7f4b;
        width: 100%;
        border: none;
        border-radius: 8px;
        color: white;
        --bs-btn-active-bg: #146c3f;
        --bs-btn-active-border-color: #146c3f;
        --bs-btn-active-color: white;
    }

    .btn-custom:hover,
    .btn-custom:focus,
    .btn-custom:active {
        background: #146c3f;
        color: white;
    }
}

/* OTP Input Styling */
.otp-input {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #7a8a99;
    color: #393939;
    text-align: center;
    font-family: "Inter";
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: -0.4px;
}

/* Larger OTP inputs on tablets and desktop */
@media (min-width: 576px) {
    .otp-input {
        width: 52px;
        height: 52px;
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -0.48px;
    }
}

.otp-input:active,
.otp-input:focus,
.otp-input:focus-visible {
    border: 2px solid #006dc0;
    outline: none;
}

.otp-input.filled {
    border: 2px solid #006dc0;
}

.otp-input.error {
    border: 2px solid #ff0038;
    color: #ff0038;
}


.modal-description-text {
    text-align: center;
    font-size: 14px;
    line-height: 24px;
    margin: 12px 29px;

    h2,
    .modal-success-message {
        font-size: 18px;
        margin: 0.83em 0;
        line-height: 24px;
        font-weight: bold;
    }
}

/* Secondary text links (e.g. "Forgot password?"): readable size and a 24px minimum tap target (WCAG 2.5.8). */
.aux-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    font-size: 0.875rem;
}

/* Keyboard focus: a clearly visible ring (>= 3:1) on every interactive control. */
.btn:focus-visible,
.btn-custom:focus-visible,
.btn-external:focus-visible,
.btn-link:focus-visible,
.back-btn:focus-visible,
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible {
    outline: 3px solid #006dc0;
    outline-offset: 2px;
    box-shadow: none;
}

.form-control:focus-visible,
.form-select:focus-visible,
.form-outline .form-control:focus-visible {
    outline: none;
    border-color: #006dc0;
    box-shadow: 0 0 0 1px #006dc0, 0 0 0 4px rgba(0, 109, 192, 0.25);
}

.form-outline .form-control.invalid:focus-visible {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545, 0 0 0 4px rgba(220, 53, 69, 0.25);
}

.form-check-input:focus-visible {
    outline: 3px solid #006dc0;
    outline-offset: 2px;
}

/* Bootstrap's #dee2e6 checkbox border is ~1.3:1 on white; match the text inputs (>= 3:1, WCAG 1.4.11). */
.form-check-input {
    border-color: #7a8a99;
}

.otp-input:focus-visible {
    outline: 3px solid #006dc0;
    outline-offset: 2px;
}

.otp-input.error:focus-visible {
    outline-color: #ff0038;
}

/* Bootstrap fades disabled buttons to 65% opacity, which leaves link-style buttons (e.g. "Resend code"
   during its cooldown) at ~2:1. Keep them legible (5.4:1) while still looking inactive. */
.btn-link:disabled,
.btn-link.disabled {
    color: #5f6b77;
    opacity: 1;
}

/* Windows High Contrast (forced colours) drops box-shadows and recolours borders, so the shadow/border
   focus rings above disappear there. Draw a system-coloured outline on every focused control instead. */
@media (forced-colors: active) {
    :focus-visible,
    .form-control:focus,
    .otp-input:focus {
        outline: 3px solid Highlight !important;
        outline-offset: 2px !important;
    }
}

/* Alternatives to the current method: a compact, left-aligned list of one-line actions. */
.twofa-alternatives {
    text-align: start;
}
.twofa-alternatives-title {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}
.twofa-alternative {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    text-align: start;
    text-decoration: none;
}
.twofa-alternative:hover {
    text-decoration: underline;
}
[aria-busy="true"] {
    cursor: progress;
}

/* Icon-only buttons: at least a 32px target (WCAG 2.5.8 asks for 24px). */
.icon-tap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

/* Visible required-field marker; the input's required attribute conveys this to assistive tech. */
.required-marker {
    color: #b02a37;
    margin-inline-start: 2px;
}

/* Users who ask for less motion get instant state changes; progress spinners keep turning. */
@media (prefers-reduced-motion: reduce) {
    *:not(.spinner-border):not(.spinner-grow),
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
