/* ==========================================================================
   Khamajer sign-in pages, on the reference portal's auth stylesheet
   --------------------------------------------------------------------------
   portal/css/auth-style.css is the reference's own compiled sheet. This file
   only carries what the reference keeps inline in its auth layout (the brand
   colour on the submit button and focus ring), the owner's 10-20px corners,
   and aliases for the older auth views' markup (.form-header, .form-group,
   .btn-brand, .error-msg) so every auth page looks like the login.
   ========================================================================== */

*, body, h1, h2, h3, h4, h5, h6, .btn, .form-control {
    font-family: 'Tajawal', sans-serif !important;
}

.auth-body,
.account-page {
    background-color: #eef3fb !important;
}

.auth-card {
    border-radius: 16px !important;
}

.auth-card__logo {
    text-align: center;
}

.auth-card__logo-img {
    max-height: 80px !important;
    width: auto !important;
    object-fit: contain !important;
    margin-bottom: 1rem;
}

.auth-card__header,
.form-header {
    text-align: center;
}

.form-header h2 {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 .35rem;
    line-height: 1.25;
}

.auth-link {
    color: var(--lm-auth-primary) !important;
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--lm-auth-primary-hover) !important;
}

.form-control,
.auth-field__input,
.password-field__input {
    border-radius: 10px !important;
}

.form-control:focus,
.password-field__input:focus {
    border-color: var(--lm-auth-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--lm-auth-primary-rgb), .12) !important;
}

.auth-submit-btn,
.btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--lm-auth-primary) !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, var(--lm-auth-primary) 0%, var(--lm-auth-secondary) 100%) !important;
    box-shadow: 0 8px 20px rgba(var(--lm-auth-primary-rgb), .22) !important;
    transition: box-shadow .16s ease, transform .12s ease;
}

.auth-submit-btn:hover,
.auth-submit-btn:focus,
.btn-brand:hover,
.btn-brand:focus {
    box-shadow: 0 12px 26px rgba(var(--lm-auth-primary-rgb), .32) !important;
}

.auth-login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

/* The older auth views' markup, in the login's look. */
.form-group {
    margin-bottom: 1rem;
}

.form-group .form-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .85rem;
    font-weight: 700;
    color: #334155;
}

.error-msg {
    margin-top: .3rem;
    font-size: .8rem;
    color: #dc2626;
}

.alert {
    border-radius: 10px !important;
}

/* Two-factor sign-in: enrolment, challenge and recovery codes. */
.two-factor__intro {
    color: #475569;
    font-size: .9rem;
    line-height: 1.6;
    margin: .5rem 0 0;
}

.two-factor__steps {
    padding-inline-start: 1.1rem;
}

.two-factor__qr {
    display: flex;
    justify-content: center;
    width: fit-content;
    margin: 1.25rem auto .75rem;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.two-factor__qr svg {
    display: block;
    width: 192px;
    height: 192px;
}

.two-factor__key,
.two-factor__codes li {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    user-select: all;
}

.two-factor__key {
    display: block;
    padding: .6rem .8rem;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: .95rem;
    letter-spacing: .06em;
    text-align: center;
    word-break: break-all;
}

.two-factor__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 1.35rem !important;
    letter-spacing: .35em;
    text-align: center;
}

.two-factor__codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}

.two-factor__codes li {
    padding: .55rem .5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    font-size: .95rem;
    text-align: center;
}

.two-factor__alt {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid #e2e8f0;
}

.two-factor__alt summary {
    cursor: pointer;
    color: var(--lm-auth-primary);
    font-size: .9rem;
    font-weight: 700;
}

.two-factor__signout {
    padding: 0;
    border: 0;
    background: none;
    color: #64748b;
    font-size: .85rem;
    text-decoration: underline;
}


/* Safe centring: a card taller than the screen (two-factor enrolment with
   its QR code and key) starts at the top and scrolls instead of being cut
   off above the viewport. Auto margins centre it when it fits. */
/* The portal theme sets html, body { height: 100% } and body { overflow:
   hidden }, which clips anything taller than the screen; the sign-in pages
   scroll the page itself. */
html:has(> body.auth-body),
body.auth-body {
    height: auto !important;
    min-height: 100%;
    overflow-y: auto !important;
}

.account-page {
    align-items: flex-start !important;
}

.account-page > .container {
    margin-top: auto;
    margin-bottom: auto;
}
