/* ============================================================
   شاشات الدخول بالواتساب — خطوتين على نفس الشكل
   ============================================================ */
* { box-sizing: border-box; }

body.wa-auth {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background: #f4f6fb;
    color: #0f172a;
    min-height: 100vh;
}

.wa-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}
.wa-wrap--single { grid-template-columns: 1fr; }

/* ===== الجانب التسويقي ===== */
.wa-aside {
    position: relative;
    background: linear-gradient(135deg, var(--c-primary, #4f46e5) 0%, var(--c-accent, #7c3aed) 55%, #6d28d9 100%);
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.wa-aside::before,
.wa-aside::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}
.wa-aside::before { width: 420px; height: 420px; top: -140px; right: -120px; }
.wa-aside::after  { width: 320px; height: 320px; bottom: -110px; left: -90px; }

.wa-aside-inner {
    position: relative;
    z-index: 1;
    padding: 56px 48px;
    width: 100%;
}
.wa-aside h1 {
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    font-weight: 900;
    line-height: 1.4;
    margin: 0 0 14px;
}
.wa-aside p {
    font-size: 15px;
    opacity: .9;
    line-height: 1.9;
    margin: 0 0 28px;
    max-width: 420px;
}
.wa-perks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.wa-perks li {
    display: flex; align-items: center; gap: 12px;
    font-size: 14.5px; font-weight: 600;
}
.wa-perks i {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 255, 255, .16);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
}
.wa-aside-teacher {
    position: absolute;
    bottom: 0; left: 24px;
    max-height: 46vh; width: auto;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .3));
    pointer-events: none;
}

/* ===== الفورم ===== */
.wa-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
.wa-card {
    background: #fff;
    width: 100%;
    max-width: 430px;
    border-radius: 22px;
    padding: 38px 34px 30px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
    border: 1px solid #eef1f7;
}

.wa-logo { text-align: center; margin-bottom: 22px; }
.wa-logo a { text-decoration: none; color: var(--c-primary, #4f46e5); font-weight: 900; font-size: 20px; }
.wa-logo img { max-height: 46px; }

/* مؤشر الخطوات */
.wa-steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 22px; }
.wa-steps .dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #eef1f7; color: #94a3b8;
    font-size: 12px; font-weight: 800;
}
.wa-steps .dot.is-on { background: var(--c-primary, #4f46e5); color: #fff; }
.wa-steps .dot.is-done { background: #16a34a; color: #fff; }
.wa-steps .line { width: 46px; height: 3px; border-radius: 3px; background: #eef1f7; }
.wa-steps .line.is-on { background: #16a34a; }

.wa-card h2 {
    font-size: 21px; font-weight: 800;
    text-align: center; margin: 0 0 8px;
}
.wa-sub {
    font-size: 13.5px; color: #64748b;
    text-align: center; line-height: 1.9; margin: 0 0 22px;
}
.wa-phone-shown { color: #0f172a; direction: ltr; display: inline-block; unicode-bidi: embed; }
.wa-change {
    color: var(--c-primary, #4f46e5); font-size: 12.5px; font-weight: 700;
    text-decoration: none; margin-inline-start: 6px;
}
.wa-change:hover { text-decoration: underline; }

/* التنبيهات */
.wa-alert {
    border-radius: 11px; padding: 11px 14px;
    font-size: 13px; font-weight: 600; margin-bottom: 16px;
    line-height: 1.7;
}
.wa-alert.is-ok   { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.wa-alert.is-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.wa-alert.is-err  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* حقول */
.wa-label {
    display: block; font-size: 13px; font-weight: 700;
    color: #334155; margin-bottom: 7px;
}
.wa-input {
    width: 100%; padding: 12px 14px;
    border: 1.6px solid #e5e9f2; border-radius: 11px;
    font-size: 14px; font-family: inherit; outline: none;
    background: #fff; margin-bottom: 14px;
    transition: border-color .18s, box-shadow .18s;
}
.wa-input:focus { border-color: var(--c-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 79, 70, 229), .12); }

/* حقل الموبايل */
.wa-phone {
    display: flex; direction: ltr;
    border: 1.8px solid #e5e9f2; border-radius: 12px;
    overflow: hidden; transition: border-color .18s, box-shadow .18s;
    background: #fff;
}
.wa-phone:focus-within { border-color: var(--c-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 79, 70, 229), .14); }
.wa-cc {
    background: var(--c-primary-light, #eef2ff); color: var(--c-primary, #4f46e5);
    padding: 14px 16px; font-size: 15px; font-weight: 800;
    border-right: 1px solid rgba(var(--c-primary-rgb, 79, 70, 229), .18);
    display: flex; align-items: center;
}
.wa-phone input {
    flex: 1; border: 0; outline: none;
    padding: 14px 16px; font-size: 16px;
    font-family: inherit; letter-spacing: 1.5px;
    direction: ltr; text-align: left; background: transparent;
}
.wa-hint { display: block; font-size: 11.5px; color: #94a3b8; margin: 7px 2px 0; }

/* خانات الكود */
.wa-otp { display: flex; gap: 9px; justify-content: center; margin: 4px 0 20px; }
.wa-otp-box {
    width: 50px; height: 58px;
    border: 2px solid #e5e9f2; border-radius: 13px;
    text-align: center; font-size: 24px; font-weight: 800;
    font-family: inherit; color: #0f172a; outline: none;
    transition: border-color .18s, box-shadow .18s, transform .18s;
    background: #fff;
}
.wa-otp-box:focus {
    border-color: var(--c-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 79, 70, 229), .14);
    transform: translateY(-2px);
}

/* بيانات المستخدم الجديد */
.wa-newuser {
    background: #f8fafc; border: 1px solid #e8ecf3;
    border-radius: 14px; padding: 16px; margin-bottom: 18px;
}
.wa-newuser-head {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 800; color: var(--c-primary, #4f46e5); margin-bottom: 14px;
}

/* الأزرار */
.wa-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    padding: 14px; border: 0; border-radius: 12px;
    background: var(--c-primary, #4f46e5); color: #fff;
    font-size: 15px; font-weight: 800; font-family: inherit;
    cursor: pointer; transition: all .2s;
    box-shadow: 0 4px 14px rgba(var(--c-primary-rgb, 79, 70, 229), .3);
}
.wa-btn:hover:not(:disabled) { background: var(--c-primary-hover, #4338ca); transform: translateY(-1px); box-shadow: 0 7px 20px rgba(var(--c-primary-rgb, 79, 70, 229), .38); }
.wa-btn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.wa-btn.is-loading { opacity: .8; cursor: wait; }

.wa-link-btn {
    background: none; border: 0; cursor: pointer;
    color: var(--c-primary, #4f46e5); font-family: inherit;
    font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px;
}
.wa-link-btn:hover { text-decoration: underline; }

/* إعادة الإرسال والصلاحية */
.wa-resend { text-align: center; margin-top: 18px; font-size: 13px; color: #64748b; }
.wa-resend strong { color: #0f172a; }
.wa-expiry {
    text-align: center; margin-top: 10px;
    font-size: 12px; color: #94a3b8;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.wa-expiry strong { color: #64748b; direction: ltr; }

/* اختيار الحساب */
.wa-accounts { display: flex; flex-direction: column; gap: 10px; }
.wa-account {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 13px 15px;
    background: #fff; border: 1.6px solid #e5e9f2; border-radius: 13px;
    cursor: pointer; font-family: inherit; text-align: right;
    transition: all .2s;
}
.wa-account:hover {
    border-color: var(--c-primary, #4f46e5); background: #f8faff;
    transform: translateX(-3px);
    box-shadow: 0 4px 14px rgba(var(--c-primary-rgb, 79, 70, 229), .12);
}
.wa-account img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.wa-account-name { flex: 1; font-size: 14.5px; font-weight: 700; color: #0f172a; }
.wa-account i { color: #94a3b8; }

/* الفوتر */
.wa-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-top: 22px; padding-top: 16px;
    border-top: 1px solid #eef1f7;
}
.wa-foot a {
    font-size: 12.5px; color: #94a3b8; text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.wa-foot a:hover { color: var(--c-primary, #4f46e5); }
.wa-admin-link { font-weight: 700; }

/* ===== موبايل ===== */
@media (max-width: 991px) {
    .wa-wrap { grid-template-columns: 1fr; }
    .wa-aside { display: none; }
    .wa-main { padding: 24px 16px; min-height: 100vh; }
    .wa-card { padding: 30px 22px 24px; box-shadow: 0 6px 24px rgba(15, 23, 42, .07); }
}
@media (max-width: 400px) {
    .wa-otp { gap: 6px; }
    .wa-otp-box { width: 44px; height: 52px; font-size: 21px; }
}

/* ============================================================
   شاشة الدخول — رقم + كلمة مرور
   ============================================================ */
.wa-pass { position: relative; }
.wa-pass .wa-input { padding-inline-end: 44px; width: 100%; }
.wa-eye {
    position: absolute; inset-inline-end: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: #94a3b8; padding: 6px; line-height: 1;
}
.wa-eye:hover { color: var(--c-primary, #4f46e5); }

.wa-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 14px 0 18px; flex-wrap: wrap;
}
.wa-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: #475569; cursor: pointer; margin: 0; }
.wa-check input { margin: 0; cursor: pointer; }
.wa-forgot {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; font-weight: 700; color: var(--c-primary, #4f46e5); text-decoration: none;
}
.wa-forgot:hover { text-decoration: underline; }

.wa-signup {
    display: inline-block; font-weight: 800;
    color: var(--c-primary, #4f46e5); text-decoration: none;
    border-bottom: 2px solid var(--c-primary, #4f46e5); padding-bottom: 1px;
}
.mt-3 { margin-top: 14px; }
.req { color: #dc2626; }

/* ============================================================
   شاشة التسجيل — 3 خطوات
   ============================================================ */
.reg-page { background: linear-gradient(180deg, var(--c-primary-light, #eef2ff) 0%, #f8fafc 45%); min-height: 100vh; }
.reg-wrap { max-width: 720px; margin: 0 auto; padding: 30px 18px 60px; }

.reg-head { text-align: center; margin-bottom: 26px; }
.reg-logo a { display: inline-block; text-decoration: none; font-size: 21px; font-weight: 900; color: var(--c-primary, #4f46e5); }
.reg-logo img { height: 56px; width: auto; max-width: 190px; object-fit: contain; }
.reg-head h1 { font-size: clamp(1.3rem, 3.4vw, 1.75rem); font-weight: 900; color: #0f172a; margin: 12px 0 0; }

/* شريط الخطوات */
.reg-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 26px; }
.reg-step { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.rs-dot {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 2px solid #e2e8f0; color: #94a3b8;
    font-weight: 800; font-size: 15px; transition: all .3s ease;
}
.reg-step.is-on .rs-dot {
    background: var(--c-primary, #4f46e5); border-color: var(--c-primary, #4f46e5);
    color: #fff; box-shadow: 0 4px 14px rgba(var(--c-primary-rgb, 79, 70, 229), .3);
}
.rs-label { font-size: 12px; font-weight: 700; color: #94a3b8; white-space: nowrap; }
.reg-step.is-on .rs-label { color: var(--c-primary, #4f46e5); }
.rs-line { flex: 1; height: 2px; background: #e2e8f0; margin: 0 6px 22px; max-width: 90px; transition: background .3s ease; }
.rs-line.is-on { background: var(--c-primary, #4f46e5); }

.reg-alert { margin-bottom: 18px; }

/* الكارت */
.reg-card {
    background: #fff; border: 1px solid #e6e9f2; border-radius: 18px;
    padding: 26px 28px; box-shadow: 0 6px 26px rgba(15, 23, 42, .06);
}
.reg-card-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.reg-card-head > i {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-primary-light, #eef2ff); color: var(--c-primary, #4f46e5); font-size: 19px;
}
.reg-card-head h2 { font-size: 17px; font-weight: 900; color: #0f172a; margin: 0 0 2px; }
.reg-card-head p { font-size: 13px; color: #64748b; margin: 0; }

.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reg-field { margin-bottom: 14px; }
.reg-field label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px;
}
.reg-field label i { color: #94a3b8; font-size: 14px; }
.reg-field input[type="text"],
.reg-field input[type="tel"],
.reg-field input[type="email"],
.reg-field input[type="password"],
.reg-field select {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 11px;
    font-family: inherit; font-size: 14px; color: #0f172a;
    background: #f8fafc; transition: all .2s ease;
}
.reg-field input:focus, .reg-field select:focus {
    outline: none; border-color: var(--c-primary, #4f46e5); background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 79, 70, 229), .12);
}
.reg-field.has-error input, .reg-field.has-error select { border-color: #ef4444; background: #fef2f2; }
.reg-hint { display: block; font-size: 11.5px; color: #94a3b8; margin-top: 5px; }

/* اختيار النوع */
.reg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reg-choice .choice {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; border: 1.5px solid #e2e8f0; border-radius: 12px;
    background: #f8fafc; cursor: pointer; font-weight: 700; font-size: 14px;
    color: #475569; margin: 0; transition: all .2s ease;
}
/* مش display:none — ده بيشيل العنصر من ترتيب الكيبورد خالص.
   بنخفيه بصرياً وبنسيبه قابل للتركيز. */
.reg-choice .choice input {
    position: absolute; opacity: 0; width: 1px; height: 1px;
    margin: 0; pointer-events: none;
}
.reg-choice .choice:focus-within {
    border-color: var(--c-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 79, 70, 229), .18);
}
.reg-choice .choice.is-on {
    border-color: var(--c-primary, #4f46e5); background: var(--c-primary-light, #eef2ff);
    color: var(--c-primary, #4f46e5);
}

/* الموافقة على الشروط */
.reg-terms {
    display: flex; align-items: flex-start; gap: 9px;
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 13px 15px; margin: 6px 0 18px; font-size: 13px; color: #475569; cursor: pointer;
}
.reg-terms input { margin-top: 3px; flex-shrink: 0; cursor: pointer; }
.reg-terms a { color: var(--c-primary, #4f46e5); font-weight: 700; text-decoration: none; }
.reg-terms a:hover { text-decoration: underline; }
.reg-terms:has(input.is-invalid), .reg-terms:has(input:invalid:not(:placeholder-shown)) { border-color: #ef4444; }

.wa-btn.is-ghost {
    background: #fff; color: #475569; border: 1.5px solid #e2e8f0;
    box-shadow: none; margin-top: 9px;
}
.wa-btn.is-ghost:hover:not(:disabled) { border-color: var(--c-primary, #4f46e5); color: var(--c-primary, #4f46e5); }
.wa-btn:disabled { opacity: .55; cursor: not-allowed; }

.wa-expiry.is-expired { color: #dc2626; }

@media (max-width: 575px) {
    .reg-wrap { padding: 20px 14px 40px; }
    .reg-card { padding: 20px 17px; border-radius: 15px; }
    .reg-grid, .reg-choice { grid-template-columns: 1fr; }
    .rs-label { display: none; }
    .rs-line { margin-bottom: 0; }
    .rs-dot { width: 36px; height: 36px; font-size: 14px; }
}
