/* Admin authentication pages (login, password recovery). Formal, RTL-first. */
:root {
    --auth-bg: #eef1f5;
    --auth-surface: #ffffff;
    --auth-border: #d9dfe7;
    --auth-input-border: #c9d1dc;
    --auth-text: #14233c;
    --auth-muted: #5f6b7a;
    --auth-primary: #1b365d;
    --auth-primary-hover: #132845;
    --auth-focus: rgba(27, 54, 93, .18);
    --auth-danger: #a12a2a;
    --auth-danger-bg: #fbeeee;
    --auth-success: #1d6b3f;
    --auth-success-bg: #eaf5ee;
    --auth-note-bg: #f4f6f9;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.auth-body {
    margin: 0;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-top: 4px solid var(--auth-primary);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(20, 35, 60, .04), 0 8px 24px rgba(20, 35, 60, .06);
}

.auth-card__brand {
    display: flex;
    justify-content: center;
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--auth-border);
}

.auth-card__brand img {
    height: 64px;
    width: auto;
    display: block;
}

.auth-card__body { padding: 28px 32px 32px; }

.auth-eyebrow {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-muted);
}

.auth-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.auth-title--spaced { margin-bottom: 18px; }

.auth-lead {
    margin: 0 0 22px;
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-steps {
    display: flex;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.auth-steps li {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--auth-border);
}

.auth-steps li.is-active { background: var(--auth-primary); }

.auth-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 10px 12px;
    background: var(--auth-note-bg);
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-note i { margin-top: 3px; color: var(--auth-primary); }

.auth-alert {
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
}

.auth-alert--success { background: var(--auth-success-bg); border-color: #cfe6d7; color: var(--auth-success); }
.auth-alert--danger,
.validation-summary-errors { background: var(--auth-danger-bg); border: 1px solid #f0d2d2; color: var(--auth-danger); }

.validation-summary-valid { display: none; }

.validation-summary-errors {
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.validation-summary-errors ul { margin: 0; padding: 0; list-style: none; }

.auth-field { margin-bottom: 18px; }

.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-input-border);
    border-radius: 6px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input::placeholder { color: #9aa4b2; }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-focus);
}

/* Emails are typed left-to-right; keep the Arabic placeholder right-aligned while empty. */
.auth-input--ltr { direction: ltr; text-align: left; }
.auth-input--ltr:placeholder-shown { direction: rtl; text-align: right; }

.field-validation-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--auth-danger);
}

.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-left: 46px; }

.auth-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    font-size: 17px;
    color: var(--auth-muted);
    background: #fff;
    border: 1px solid var(--auth-input-border);
    border-radius: 6px;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.auth-icon-btn:hover { color: var(--auth-primary); border-color: var(--auth-primary); }
.auth-icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--auth-focus); }

.auth-input-wrap .auth-icon-btn {
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
    background: transparent;
}

.auth-captcha {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.auth-captcha .auth-input { flex: 1; min-width: 0; }

.auth-captcha__image {
    height: 46px;
    width: 140px;
    object-fit: cover;
    border: 1px solid var(--auth-input-border);
    border-radius: 6px;
    background: #fff;
}

/* 6-digit verification code */
.auth-otp {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    direction: ltr;
}

.auth-otp__box {
    flex: 1;
    min-width: 0;
    max-width: 56px;
    height: 56px;
    padding: 0;
    font: inherit;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-input-border);
    border-radius: 6px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-otp__box:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-focus);
}

.auth-otp__box.is-filled { border-color: var(--auth-primary); }

.auth-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-rules {
    margin: 0 0 20px;
    padding: 10px 12px;
    list-style: none;
    background: var(--auth-note-bg);
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-rules li { position: relative; padding-right: 16px; }
.auth-rules li + li { margin-top: 2px; }

.auth-rules li::before {
    content: "";
    position: absolute;
    right: 2px;
    top: .7em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--auth-primary);
}

/* Prefix + number, read left-to-right like the phone number itself. */
.auth-phone {
    display: flex;
    gap: 8px;
    direction: ltr;
}

.auth-phone .auth-select { flex: 0 0 120px; }
.auth-phone .auth-input { flex: 1; min-width: 0; }

.auth-select {
    height: 46px;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-input-border);
    border-radius: 6px;
}

.auth-select:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-focus);
}

.auth-resend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-resend form { margin: 0; }

.auth-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 24px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--auth-primary);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.auth-btn:hover { background: var(--auth-primary-hover); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--auth-focus); }

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    font-size: 14px;
}

.auth-links--center { justify-content: center; }

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--auth-primary);
    background: none;
    border: 0;
    text-decoration: none;
    cursor: pointer;
}

.auth-link:hover { text-decoration: underline; }
.auth-link--muted { color: var(--auth-muted); font-weight: 500; }

.auth-footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--auth-muted);
    text-align: center;
}

@media (max-width: 480px) {
    .auth-page { padding-top: 24px; }
    .auth-card__brand { padding: 22px 20px 16px; }
    .auth-card__body { padding: 22px 20px 24px; }
    .auth-captcha { flex-wrap: wrap; }
    .auth-captcha .auth-input { flex-basis: 100%; order: 3; }
    .auth-captcha__image { flex: 1; }
    .auth-links { flex-direction: column; }
}
