/* ==========================================================================
   Auth Pages — مطابق لهوية قالب MenuQRCode
   --------------------------------------------------------------------------
   كل القيم أدناه منقولة من :root ومن مكوّنات القالب (style.css):
   - الخط: Noto Kufi Arabic (أوزان 500–800)
   - الألوان: --brand / --brand-ink / --green-ink / --chip / --surface / zinc
   - الأشكال: حقول وأزرار pill (9999px)، كروت radius 1.5rem بلا حدود ولا ظل
   - الأحجام: نفس سلّم القالب (.8 / .875 / .95 / 1 / 1.5 / 1.85 rem)
   الخط نفسه يُعرَّف من القالب (أو من font/authpg-fonts.css عند غيابه).
   ========================================================================== */

.authpg-auth-body,
.authpg-auth-shortcode {
    --authpg-ink: #121212;
    --authpg-heading: #3a3a3a;
    --authpg-brand: #074942;
    --authpg-brand-ink: #eafff6;
    --authpg-green: #2fb04a;
    --authpg-green-ink: #15692a;
    --authpg-chip: #f1f1f3;
    --authpg-chip-hover: #e7e7ea;
    --authpg-surface: #f7f7f8;
    --authpg-zinc-500: #63636c;
    --authpg-zinc-600: #52525b;
    --authpg-zinc-700: #3f3f46;
    --authpg-line: rgba(18, 18, 18, .14);
    --authpg-radius-lg: 1.5rem;
    --authpg-radius-md: 1rem;
    --authpg-pill: 9999px;
    --authpg-danger: #e23232;
    --authpg-danger-bg: rgba(226, 50, 50, .08);
    --authpg-warn: #b45309;
    --authpg-success-bg: rgba(47, 176, 74, .1);
    --authpg-gutter: 1.5rem;
    --authpg-section-space: 4rem;
    color: var(--authpg-ink);
    direction: rtl;
    font-family: "Noto Kufi Arabic", "Noto Kufi Fallback", "Segoe UI", Tahoma, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.authpg-auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #fff;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.authpg-auth-body *,
.authpg-auth-body *::before,
.authpg-auth-body *::after,
.authpg-auth-shortcode *,
.authpg-auth-shortcode *::before,
.authpg-auth-shortcode *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* الروابط بلا تسطير في كل الحالات (مثل القالب) */
.authpg-auth-body a,
.authpg-auth-body a:hover,
.authpg-auth-body a:focus,
.authpg-auth-body a:active,
.authpg-auth-body a:visited,
.authpg-auth-shortcode a,
.authpg-auth-shortcode a:hover,
.authpg-auth-shortcode a:focus,
.authpg-auth-shortcode a:active,
.authpg-auth-shortcode a:visited {
    text-decoration: none;
}

/* ----- الهيكل: عمود واحد، النموذج متمركز في منتصف الصفحة ----- */
.authpg-auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem var(--authpg-gutter);
    box-sizing: border-box;
}

.authpg-auth-layout {
    width: min(26rem, 100%);
}

/* ----- الكرت: على صفحة كاملة بدون خلفية (النموذج هو الصفحة) ----- */
.authpg-auth-card {
    width: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.authpg-auth-title {
    margin: 0 0 .5rem;
    color: var(--authpg-heading);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.4;
    text-align: start;
}

.authpg-auth-head {
    margin: 0;
}

.authpg-auth-description {
    margin: 0 0 1.5rem;
    color: var(--authpg-zinc-500);
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.75;
    text-align: start;
}

.authpg-auth-form {
    margin: 0;
}

.authpg-auth-field {
    margin: 0 0 1.125rem;
}

.authpg-auth-label {
    display: block;
    margin: 0 0 .5rem;
    color: var(--authpg-zinc-700);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
}

.authpg-auth-label--required::after {
    content: " *";
    color: var(--authpg-danger);
}

.authpg-auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 0 .5rem;
}

.authpg-auth-label-row .authpg-auth-label {
    margin: 0;
}

/* ----- الحقول: نفس .search-field في القالب (pill، 2.75rem، حد 1.5px) ----- */
.authpg-auth-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    border: 1.5px solid var(--authpg-line);
    border-radius: var(--authpg-pill);
    background: #fff;
    color: var(--authpg-ink);
    font: inherit;
    font-size: .95rem;
    font-weight: 500;
    line-height: normal;
    outline: none;
    padding: 0 1.1rem;
    text-align: right;
    transition: border-color .2s, box-shadow .2s;
}

.authpg-auth-input::placeholder {
    color: #a1a1aa;
}

.authpg-auth-input:focus {
    border-color: var(--authpg-brand);
    box-shadow: 0 0 0 3px rgba(7, 73, 66, .15);
}

.authpg-auth-field.is-error .authpg-auth-input {
    border-color: var(--authpg-danger);
}

.authpg-auth-field-error {
    display: none;
    align-items: center;
    gap: .375rem;
    margin: .5rem 0 0;
    padding-inline: .5rem;
    color: var(--authpg-danger);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: right;
}

.authpg-auth-field.is-error .authpg-auth-field-error {
    display: flex;
}

.authpg-auth-hint {
    margin: .5rem 0 0;
    padding-inline: .5rem;
    color: var(--authpg-zinc-500);
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.6;
    text-align: right;
}

.authpg-auth-password {
    position: relative;
}

.authpg-auth-password .authpg-auth-input {
    padding-left: 3rem;
}

.authpg-auth-password-toggle {
    position: absolute;
    top: 50%;
    left: .5rem;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--authpg-pill);
    background: transparent;
    color: var(--authpg-zinc-500);
    cursor: pointer;
    padding: 0;
    transform: translateY(-50%);
    transition: color .2s, background-color .2s;
}

.authpg-auth-password-toggle:hover,
.authpg-auth-password-toggle:focus-visible {
    color: var(--authpg-ink);
    background: var(--authpg-chip);
    outline: none;
}

.authpg-auth-password-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
}

/* ----- عدّاد قوة كلمة المرور ----- */
.authpg-auth-pw-strength {
    display: flex;
    align-items: center;
    gap: .625rem;
    margin-top: .625rem;
    padding-inline: .5rem;
}

.authpg-auth-sub-progress {
    flex: 1 1 auto;
    height: .3rem;
    border-radius: var(--authpg-pill);
    background: #e4e4e7;
    overflow: hidden;
}

.authpg-auth-pw-strength-bar {
    height: 100%;
    width: 0;
    border-radius: var(--authpg-pill);
    background: var(--authpg-danger);
    transition: width .2s, background-color .2s;
}

.authpg-auth-pw-strength-bar.is-weak { background: var(--authpg-danger); }
.authpg-auth-pw-strength-bar.is-medium { background: var(--authpg-warn); }
.authpg-auth-pw-strength-bar.is-strong { background: var(--authpg-green); }

.authpg-auth-pw-strength-label {
    flex: 0 0 auto;
    font-size: .8rem;
    font-weight: 700;
    color: var(--authpg-zinc-500);
}

.authpg-auth-pw-strength-label.is-weak { color: var(--authpg-danger); }
.authpg-auth-pw-strength-label.is-medium { color: var(--authpg-warn); }
.authpg-auth-pw-strength-label.is-strong { color: var(--authpg-green-ink); }

/* ----- checkbox (الموافقة على الشروط) ----- */
.authpg-auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    margin: 0;
    color: var(--authpg-zinc-500);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.7;
    text-align: right;
    cursor: pointer;
}

.authpg-auth-checkbox-row input {
    margin: .25rem 0 0;
    accent-color: var(--authpg-brand);
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
    cursor: pointer;
}

.authpg-auth-checkbox-row a {
    color: var(--authpg-green-ink);
    font-weight: 700;
}

.authpg-auth-checkbox-row a:hover {
    color: var(--authpg-ink);
}

.authpg-auth-field--checkbox {
    margin-bottom: 1.25rem;
}

/* Turnstile بحجمه الافتراضي (300×65)؛ نغيّر موضعه فقط: بداية السطر */
.authpg-auth-field--turnstile {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 1.125rem;
}

/* ----- روابط: نفس .compare-link a / .faq-more a في القالب ----- */
.authpg-auth-forgot-link {
    color: var(--authpg-green-ink);
    font-size: .875rem;
    font-weight: 700;
    white-space: nowrap;
    transition: color .2s;
}

.authpg-auth-forgot-link:hover,
.authpg-auth-switch a:hover {
    color: var(--authpg-ink);
}

.authpg-auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 1.25rem;
    padding: .5rem 1rem;
    border-radius: var(--authpg-pill);
    background: var(--authpg-chip);
    color: var(--authpg-zinc-700);
    font-size: .875rem;
    font-weight: 700;
    transition: background-color .2s, color .2s;
}

.authpg-auth-back-link:hover,
.authpg-auth-back-link:focus-visible {
    background: var(--authpg-chip-hover);
    color: var(--authpg-ink);
}

.authpg-auth-back-link svg {
    transform: scaleX(-1); /* السهم يشير لليمين لأن الاتجاه RTL */
}

.authpg-auth-switch {
    margin: 1.25rem 0 0;
    color: var(--authpg-zinc-600);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
}

.authpg-auth-switch a {
    color: var(--authpg-green-ink);
    font-weight: 700;
    transition: color .2s;
}

/* ----- الزر: نفس .hero-btn / .cta-pill (pill، brand، brand-ink، hover = رفع فقط) ----- */
.authpg-auth-button {
    display: inline-flex;
    min-width: 7.25rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--authpg-pill);
    background: var(--authpg-brand);
    color: var(--authpg-brand-ink);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    padding: .7rem 1.6rem;
    text-align: center;
    white-space: nowrap;
    transition: transform .2s;
}

@media (min-width: 640px) {
    .authpg-auth-button {
        min-height: 3rem;
    }
}

.authpg-auth-button:hover,
.authpg-auth-button:focus-visible {
    color: var(--authpg-brand-ink);
    transform: translateY(-1px);
}

.authpg-auth-button:active {
    transform: scale(.98);
}

.authpg-auth-button:disabled,
.authpg-auth-button.is-loading {
    opacity: .7;
    cursor: progress;
    transform: none;
}

.authpg-auth-button--block {
    display: flex;
    width: 100%;
}

/* ----- فاصل "أو" + زر جوجل: نفس .login-link في القالب (pill بحد 1.5px) ----- */
.authpg-auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: var(--authpg-zinc-500);
    font-size: .875rem;
    font-weight: 700;
}

.authpg-auth-divider::before,
.authpg-auth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(18, 18, 18, .1);
}

.authpg-auth-social {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    border: 1.5px solid rgba(18, 18, 18, .12);
    border-radius: var(--authpg-pill);
    background: #fff;
    color: var(--authpg-zinc-700);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    padding: .6rem 1.3rem;
    transition: background-color .2s, border-color .2s, color .2s;
}

@media (min-width: 640px) {
    .authpg-auth-social {
        min-height: 3rem;
    }
}

.authpg-auth-social svg {
    flex: none;
}

.authpg-auth-social:hover,
.authpg-auth-social:focus-visible {
    background: var(--authpg-chip);
    border-color: transparent;
    color: var(--authpg-ink);
}

.authpg-auth-social:active {
    transform: scale(.98);
}

.authpg-auth-social-note {
    margin: .7rem 0 0;
    text-align: center;
    font-size: .8rem;
    line-height: 1.6;
    color: var(--authpg-zinc-700);
}

.authpg-auth-social-note a {
    color: inherit;
    text-decoration: underline;
}

/* ----- honeypot: مخفي بصريًا ومن قارئات الشاشة (ليس display:none) ----- */
.authpg-auth-hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ----- التنبيهات ----- */
.authpg-auth-notice {
    margin: 0 0 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--authpg-radius-md);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.7;
    padding: .875rem 1rem;
    text-align: right;
}

.authpg-auth-notice-text {
    margin: 0;
}

.authpg-auth-notice--error {
    --authpg-notice-color: var(--authpg-danger);
    border-color: rgba(226, 50, 50, .22);
    background: var(--authpg-danger-bg);
    color: var(--authpg-notice-color);
}

.authpg-auth-notice--success {
    --authpg-notice-color: var(--authpg-green-ink);
    border-color: rgba(47, 176, 74, .28);
    background: var(--authpg-success-bg);
    color: var(--authpg-notice-color);
}

.authpg-auth-resend-form {
    margin-top: .625rem;
}

.authpg-auth-resend-btn {
    border: 1.5px solid var(--authpg-notice-color, currentColor);
    border-radius: var(--authpg-pill);
    background: transparent;
    color: var(--authpg-notice-color, inherit);
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    padding: .4rem .9rem;
    transition: background-color .2s, color .2s;
}

/* نستخدم متغيّر ثابت بدل currentColor للخلفية عند التحويم؛ لأن currentColor
   سيُحسب بعد تغيير color إلى الأبيض فيصير الزر غير مرئي. */
.authpg-auth-resend-btn:hover,
.authpg-auth-resend-btn:focus-visible,
.authpg-auth-resend-btn:active {
    background: var(--authpg-notice-color, currentColor);
    color: #fff;
    outline: none;
}

.authpg-auth-shortcode {
    display: flex;
    justify-content: center;
    width: 100%;
}

.authpg-auth-shortcode .authpg-auth-card {
    max-width: 26rem;
    border-radius: var(--authpg-radius-lg);
    background: var(--authpg-surface);
    padding: 2rem;
}

/* ----- إمكانية الوصول: نفس :focus-visible في القالب ----- */
.authpg-auth-body a:focus-visible,
.authpg-auth-shortcode a:focus-visible,
.authpg-auth-checkbox-row input:focus-visible {
    outline: 3px solid var(--authpg-green-ink);
    outline-offset: 3px;
}

.authpg-auth-button:focus-visible,
.authpg-auth-back-link:focus-visible {
    outline: 3px solid var(--authpg-ink);
    outline-offset: 3px;
}

/* ----- جوال: نفس إيقاع القالب بمقياس أصغر ----- */
@media (max-width: 640px) {
    .authpg-auth-body,
    .authpg-auth-shortcode {
        --authpg-gutter: 1rem;
    }

    .authpg-auth-title {
        font-size: 1.5rem;
    }

    .authpg-auth-shortcode .authpg-auth-card {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .authpg-auth-body *,
    .authpg-auth-body *::before,
    .authpg-auth-body *::after,
    .authpg-auth-shortcode *,
    .authpg-auth-shortcode *::before,
    .authpg-auth-shortcode *::after {
        transition: none !important;
        animation: none !important;
    }
}
