@font-face {
    font-family: "Tajawal";
    src: url("/fonts/Tajawal-Medium.ttf") format("truetype");
    font-display: swap;
}

:root {
    --login-primary: #1768e5;
    --login-primary-dark: #0e4fb9;
    --login-text: #12233f;
    --login-muted: #718096;
    --login-border: #dce5f1;
    --login-danger: #c9364f;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.main-body {
    margin: 0;
    background: #f3f6fb !important;
    color: var(--login-text);
    font-family: "Tajawal", sans-serif;
}

/* Shared authentication shell used by OTP and authenticator setup pages. */
.voucher-auth-page {
    min-height: calc(100vh - 40px);
    min-height: calc(100dvh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(72px, 9vh, 96px) clamp(16px, 4vw, 48px) clamp(28px, 5vh, 48px);
}

.voucher-auth-page > .container-fluid {
    width: 100%;
}

.voucher-auth-shell {
    width: 100%;
    max-width: 520px;
    min-height: 0;
    margin: 0 auto;
}

.voucher-right {
    width: 100%;
}

.voucher-form-card {
    width: 100%;
    padding: clamp(26px, 5vw, 42px);
    color: var(--login-text);
    background: #fff;
    border: 1px solid #e4eaf2;
    border-radius: 24px;
    box-shadow: 0 20px 55px rgba(38, 55, 82, .11);
    text-align: start;
}

.voucher-small-logo {
    display: block;
    width: auto;
    max-width: min(100%, 220px);
    height: 74px;
    margin: 0 auto 24px;
    object-fit: contain;
}

.voucher-form-title {
    margin: 0 0 9px;
    color: var(--login-text);
    font-size: clamp(24px, 4vw, 30px);
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.voucher-form-subtitle {
    margin: 0 0 24px;
    color: var(--login-muted);
    font-size: 14px;
    line-height: 1.75;
    text-align: center;
}

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

.voucher-label {
    display: block;
    margin-bottom: 9px;
    color: #263b5c;
    font-size: 14px;
    font-weight: 700;
    text-align: start;
}

.voucher-input {
    width: 100%;
    height: 56px;
    padding: 10px 16px;
    color: var(--login-text);
    background: #fff;
    border: 1px solid var(--login-border);
    border-radius: 13px;
    outline: none;
    font-family: inherit;
    font-size: 18px;
    letter-spacing: .2em;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.voucher-input:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 4px rgba(23, 104, 229, .11);
}

.voucher-trust-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #526784;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.6;
    text-align: start;
}

.voucher-trust-option input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin-top: 2px;
    accent-color: var(--login-primary);
}

.voucher-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 54px;
    padding: 12px 20px;
    color: #fff;
    background: var(--login-primary);
    border: 0;
    border-radius: 13px;
    box-shadow: 0 12px 25px rgba(23, 104, 229, .22);
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.voucher-login-btn:hover,
.voucher-login-btn:focus-visible {
    color: #fff;
    background: var(--login-primary-dark);
    box-shadow: 0 14px 28px rgba(23, 104, 229, .28);
    transform: translateY(-1px);
}

.voucher-form-card .alert {
    border-radius: 12px;
    line-height: 1.6;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 48px);
}

.login-card {
    position: relative;
    width: min(100%, 440px);
    padding: clamp(28px, 5vw, 44px);
    background: #fff;
    border: 1px solid #e4eaf2;
    border-radius: 24px;
    box-shadow: 0 20px 55px rgba(38, 55, 82, .11);
}

.login-language {
    position: absolute;
    top: 18px;
    inset-inline-end: 18px;
}

.login-language button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 11px;
    color: #526784;
    background: #f6f8fc;
    border: 1px solid #e1e7f0;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.login-language button:hover,
.login-language button:focus-visible {
    color: var(--login-primary);
    background: #fff;
    border-color: #a9c5ee;
}

.login-brand {
    display: flex;
    justify-content: center;
    min-height: 68px;
    margin: 8px 0 24px;
}

.login-logo {
    display: block;
    width: auto;
    max-width: 210px;
    height: 68px;
    object-fit: contain;
}

.login-heading {
    margin-bottom: 30px;
    text-align: center;
}

.login-heading h1 {
    margin: 0 0 9px;
    color: var(--login-text);
    font-size: clamp(27px, 5vw, 32px);
    font-weight: 800;
    line-height: 1.3;
}

.login-heading p,
.login-help {
    margin: 0;
    color: var(--login-muted);
    font-size: 14px;
    line-height: 1.75;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 13px 14px;
    color: var(--login-danger);
    background: #fff3f5;
    border: 1px solid #ffd8df;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
}

.login-alert i {
    flex: 0 0 auto;
    margin-top: 3px;
}

.login-encryption-error {
    display: none;
}

.login-encryption-error.is-visible {
    display: flex;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    margin-bottom: 9px;
    color: #263b5c;
    font-size: 14px;
    font-weight: 700;
    text-align: start;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap > i {
    position: absolute;
    top: 50%;
    inset-inline-start: 17px;
    z-index: 1;
    color: #8ba0ba;
    font-size: 18px;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input {
    display: block;
    width: 100%;
    height: 56px;
    padding-inline: 48px 16px;
    color: var(--login-text);
    background: #fff;
    border: 1px solid var(--login-border);
    border-radius: 13px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    text-align: start;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.login-input::placeholder {
    color: #a1afc1;
}

.login-input:hover {
    border-color: #bdcbe0;
}

.login-input:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 4px rgba(23, 104, 229, .11);
}

.login-input.is-invalid {
    border-color: var(--login-danger);
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    margin-top: 8px;
    padding: 12px 20px;
    color: #fff;
    background: var(--login-primary);
    border: 0;
    border-radius: 13px;
    box-shadow: 0 12px 25px rgba(23, 104, 229, .22);
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.login-submit:hover,
.login-submit:focus-visible {
    color: #fff;
    background: var(--login-primary-dark);
    box-shadow: 0 14px 28px rgba(23, 104, 229, .28);
    transform: translateY(-1px);
}

.login-submit:focus-visible,
.login-language button:focus-visible {
    outline: 3px solid rgba(23, 104, 229, .22);
    outline-offset: 3px;
}

.login-submit-arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-submit-spinner {
    display: none;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .7s linear infinite;
}

.login-submit.is-loading {
    cursor: wait;
    opacity: .86;
    transform: none;
}

.login-submit.is-loading .login-submit-spinner {
    display: block;
}

.login-submit.is-loading .login-submit-arrow {
    display: none;
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

.login-help {
    margin-top: 24px;
    text-align: center;
}

@media (max-width: 575.98px) {
    .voucher-auth-page {
        min-height: calc(100vh - 40px);
        min-height: calc(100dvh - 40px);
        padding: 74px 12px 24px;
    }

    .voucher-form-card {
        padding: 26px 20px;
        border-radius: 18px;
        box-shadow: 0 14px 34px rgba(38, 55, 82, .10);
    }

    .voucher-small-logo {
        max-width: 180px;
        height: 60px;
        margin-bottom: 20px;
    }

    .login-page {
        padding: 14px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 18px;
        box-shadow: 0 14px 34px rgba(38, 55, 82, .10);
    }

    .login-language {
        top: 14px;
        inset-inline-end: 14px;
    }

    .login-brand {
        margin: 12px 0 20px;
    }

    .login-logo {
        max-width: 180px;
        height: 58px;
    }

    .login-heading {
        margin-bottom: 25px;
    }
}

@media (max-height: 650px) and (min-width: 576px) {
    .login-page {
        padding-block: 18px;
    }

    .login-card {
        padding-block: 26px;
    }

    .login-brand,
    .login-heading {
        margin-bottom: 18px;
    }

    .login-help {
        margin-top: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-input,
    .login-submit,
    .login-language button {
        transition: none;
    }

    .login-submit-spinner {
        animation-duration: 1.4s;
    }

}
