/* ==================================================
   نظام تصميم الـ Auth — v2 (تطبيقي ومتجاوب)
   يعتمد على متغيرات public/assets/v2/css/index.css
   ================================================== */

/* يضمن ألا تخرج المكونات (أزرار/حقول) عن حدودها مع borders و paddings */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ---------- صفحة الخلفية ---------- */
.auth-page {
    background:
        radial-gradient(1200px 600px at 75% -10%, var(--brand-soft), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(254, 149, 144, 0.07), transparent 60%),
        var(--bg-body);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-x: hidden;
    position: relative;
    transition: background 0.3s;
}
html.light-mode .auth-page {
    background:
        radial-gradient(1200px 600px at 75% -10%, rgba(124, 108, 240, 0.08), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(254, 149, 144, 0.06), transparent 60%),
        var(--bg-body);
}

/* هالات ملونة خلفية (app-like) */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    transition: opacity 0.4s;
}
.blob-1 { top: -120px; right: -80px; width: 340px; height: 340px; background: var(--brand); }
.blob-2 { bottom: -140px; left: -100px; width: 380px; height: 380px; background: #fe9590; opacity: 0.14; }
.blob-3 { top: 45%; left: 8%; width: 220px; height: 220px; background: #8b5cf6; opacity: 0.2; }
.light-mode .blob { opacity: 0.16; }

/* ---------- الهيكل (إطار تطبيق) ---------- */
.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* ---------- الشعار ---------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.brand-logo {
    width: 46px;
    height: 46px;
    padding: 9px;
    border-radius: 14px;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 10px 24px var(--brand-glow);
}
.brand-logo-img {
    padding: 0;
    background: none;
    object-fit: contain;
}
.brand-name {
    font-weight: 800;
    font-size: 21px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}
.brand-name b {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- زر تبديل الوضع (ليلي/نهاري) ---------- */
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-prim);
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.theme-toggle:hover {
    background: var(--bg-prim-hover);
    transform: translateY(-1px);
}
.theme-toggle .fa-sun { display: none; }
.light-mode .theme-toggle .fa-sun { display: inline; }
.light-mode .theme-toggle .fa-moon { display: none; }

/* ---------- شارة العداد — أسفل البطاقة (نقطة حية نابضة) ---------- */
.counter-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    margin: 18px auto 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}
.counter-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: counter-pulse 1.6s ease-out infinite;
}
@keyframes counter-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.counter-badge .counter-label,
.counter-badge .counter-unit { color: var(--muted); }
.counter-badge b {
    font-size: 13px;
    font-weight: 800;
    color: var(--brand);
    min-width: 20px;
    text-align: center;
}

/* عداد "ينضم إلينا الآن" — مركزي تحت عنوان التقييمات */
.join-counter {
    display: flex;
    justify-content: center;
    margin: 4px 0 14px;
}

/* رأس البطاقة: العنوان + العداد */
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.card-head-text {
    flex: 1;
    min-width: 0;
}
.card-head .auth-title { margin-bottom: 4px; }

/* ---------- البطاقة ---------- */
.auth-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%),
        var(--bg-prim);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    margin-bottom: 20px;
}
/* خط علوي متوهج فاخر */
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.7;
}
.light-mode .auth-card {
    box-shadow:
        0 18px 44px rgba(30, 33, 48, 0.1),
        0 2px 6px rgba(30, 33, 48, 0.05);
}
.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 6px;
}
.auth-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.7;
}

/* ---------- الحقول ---------- */
.field { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.field-control { position: relative; }

.field-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 14px;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}
.field-input::placeholder { color: var(--muted); opacity: 0.7; }
.field-input:hover { border-color: var(--muted); }
.field-input:focus {
    border-color: var(--brand);
    background: var(--bg-input);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.field-input[readonly] { opacity: 0.7; cursor: default; }

.field-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}
.field-input.has-icon { padding-right: 44px; }

.field-toggle {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    border-radius: 10px;
    transition: 0.2s;
}
.field-toggle:hover { color: var(--brand); background: var(--brand-soft); }
.field-input.has-toggle { padding-left: 46px; }

.field-error {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    color: var(--danger);
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* صف (تذكرني + رابط) */
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 4px 0 20px;
    flex-wrap: wrap;
}

/* ---------- الاختيار (checkbox) ---------- */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    user-select: none;
}
.checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.checkbox-mark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 11px;
    transition: 0.15s;
}
.checkbox input:checked + .checkbox-mark {
    background: var(--brand-gradient);
    border-color: transparent;
    color: #fff;
}
.checkbox input:focus-visible + .checkbox-mark {
    box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ---------- الأزرار ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 14px;
    padding: 13px 22px;
    text-decoration: none;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s, background 0.25s, color 0.25s, border-color 0.25s, filter 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 10px 24px var(--brand-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow: 0 16px 36px var(--brand-glow);
}
.btn-primary:active {
    filter: brightness(0.95);
}

.btn-google {
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.btn-google:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}
.btn-google:active { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }

.btn-ghost {
    background: var(--bg-prim-hover);
    color: var(--text-color);
}
.btn-ghost:hover {
    background: var(--brand-soft);
    color: var(--brand);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.btn-outline:hover {
    background: var(--bg-prim-hover);
    border-color: var(--brand);
    color: var(--brand);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.3);
}

/* ---------- الروابط ---------- */
.link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}
.link:hover { text-decoration: underline; }

.link-muted {
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}
.link-muted:hover { color: var(--text-color); }

/* ---------- الفاصل ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 12.5px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* فاصل "أو استخدم البريد الإلكتروني" — بين قوقل والحقول */
.form-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 22px;
    color: var(--muted);
    font-size: 12.5px;
}
.form-separator::before,
.form-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ---------- التنبيهات ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: 18px;
}
.alert i { margin-top: 3px; font-size: 14px; }
.alert-danger {
    background: var(--danger-soft);
    border-color: rgba(229, 72, 77, 0.3);
    color: var(--danger);
}
.alert-success {
    background: var(--success-soft);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--success);
}

/* ---------- نصوص التبديل (ليس لديك حساب؟) ---------- */
.auth-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--muted);
}
.auth-switch .link { font-size: 14px; }

/* ---------- قسم التقييمات (صفحة الدخول) - "شي جبار" ---------- */
.rating-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 6px;
}
.rating-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 15px;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px var(--brand-glow);
    animation: rating-bounce 2.4s ease-in-out infinite;
}
@keyframes rating-bounce {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-4px) rotate(4deg); }
}
.rating-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--text-color);
}
.rating-subtitle {
    font-size: 12.5px;
    color: var(--muted);
    margin: 2px 0 0;
}

/* لوحة النتيجة (number + bars) */
.rating-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px;
    border-radius: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 18px;
}
.rating-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(220px 120px at 85% -20%, var(--brand-soft), transparent 70%);
    pointer-events: none;
}
.rating-score {
    text-align: center;
    flex-shrink: 0;
    z-index: 1;
}
.rating-avg {
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    animation: rating-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rating-stars-hero { color: var(--warning); font-size: 12px; letter-spacing: 2px; margin-top: 6px; }
.rating-stars-hero i {
    display: inline-block;
    animation: star-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rating-stars-hero i:nth-child(1) { animation-delay: 0.15s; }
.rating-stars-hero i:nth-child(2) { animation-delay: 0.25s; }
.rating-stars-hero i:nth-child(3) { animation-delay: 0.35s; }
.rating-stars-hero i:nth-child(4) { animation-delay: 0.45s; }
.rating-stars-hero i:nth-child(5) { animation-delay: 0.55s; }
@keyframes star-pop {
    from { opacity: 0; transform: scale(0) rotate(-120deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes rating-pop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
.rating-count {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    margin-top: 6px;
}

/* أشرطة النسب — تملأ حركياً */
.rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
}
.rating-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11.5px;
    color: var(--muted);
}
.rating-bar .rating-num {
    width: 22px;
    text-align: left;
    font-weight: 700;
}
.rating-track {
    flex: 1;
    height: 7px;
    border-radius: 99px;
    background: var(--bg-prim);
    overflow: hidden;
}
.rating-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--brand-gradient);
    animation: fill-bar 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.rating-bar:nth-child(1) .rating-fill { animation-delay: 0.35s; }
.rating-bar:nth-child(2) .rating-fill { animation-delay: 0.45s; }
.rating-bar:nth-child(3) .rating-fill { animation-delay: 0.55s; }
.rating-bar:nth-child(4) .rating-fill { animation-delay: 0.65s; }
.rating-bar:nth-child(5) .rating-fill { animation-delay: 0.75s; }
@keyframes fill-bar {
    to { width: var(--bar); }
}

/* بطاقة التقييم — زجاجية بأفاتار */
.testimonial-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(160deg, var(--bg-prim-hover) 0%, var(--bg-input) 62%);
    border: 1px solid var(--border-color);
    margin-top: 16px;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.testimonial-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35), 0 0 22px var(--brand-soft);
}
.t-top {
    display: flex;
    align-items: center;
    gap: 11px;
}
.t-avatar {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    box-shadow: 0 6px 14px var(--brand-glow);
}
.t-avatar.g1 { background: linear-gradient(135deg, #6d5ee8, #a57cf0); }
.t-avatar.g2 { background: linear-gradient(135deg, #ff6b9d, #ffb347); }
.t-avatar.g3 { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.t-avatar.g4 { background: linear-gradient(135deg, #34d399, #0ea5e9); }
.t-avatar.g5 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.t-meta { min-width: 0; }
.t-name {
    margin: 0;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.t-stars {
    color: var(--warning);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    margin-top: 3px;
}
.t-text {
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--text-color);
    opacity: 0.92;
    margin: 0;
}
.t-quote { color: var(--brand); opacity: 0.65; font-size: 13px; margin-inline-end: 5px; }
.t-date {
    margin-top: auto;
    font-size: 11.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* حالة عدم وجود تقييمات */
.empty-reviews {
    text-align: center;
    padding: 26px 12px;
    color: var(--muted);
}
.empty-reviews i { font-size: 30px; opacity: 0.6; }
.empty-reviews p { margin: 10px 0 0; font-size: 13.5px; }

/* أزرار التنقل في قسم التقييمات — بجانب العنوان (لا تغطي البطاقات) */
.rating-head-text {
    flex: 1;
    min-width: 0;
}
.rating-nav {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.nav-btn:hover {
    color: #fff;
    border-color: transparent;
    background: var(--brand-gradient);
    box-shadow: 0 6px 14px var(--brand-glow);
}
.nav-btn.swiper-button-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.nav-btn.swiper-button-disabled:hover {
    background: var(--bg-input);
    color: var(--muted);
    border-color: var(--border-color);
    box-shadow: none;
}

/* ---------- دوار التحميل ---------- */
.spinner {
    width: 26px;
    height: 26px;
    border: 3px solid var(--brand-soft);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: v2-spin 0.8s linear infinite;
    margin: 14px auto;
}
@keyframes v2-spin {
    to { transform: rotate(360deg); }
}

/* ---------- تحركات ناعمة ---------- */
.auth-card {
    animation: v2-card-in 0.4s ease both;
}
@keyframes v2-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================================================
   التجاوب — جوال / ديسكتوب
   ================================================== */

/* جوال (حتى 767px): يشغل عرض الشاشة كاملاً كتطبيق حقيقي — حافة إلى حافة */
@media (max-width: 767px) {
    .auth-page {
        align-items: flex-start;
        padding: 0;
    }
    .auth-shell { max-width: 100%; }
    .auth-header {
        margin-bottom: 16px;
        padding-inline: 16px;
    }
    .brand-logo { width: 40px; height: 40px; padding: 8px; border-radius: 12px; }
    .brand-name { font-size: 19px; }
    .auth-card {
        padding: 24px 18px;
        border-radius: 0;
        border-inline: none;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
        margin-bottom: 14px;
    }
    .auth-card::before { inset-inline: 6%; }
    .auth-title { font-size: 21px; }
    .counter-badge { margin-bottom: 18px; }
    .blob-1 { width: 260px; height: 260px; }
    .blob-2 { width: 280px; height: 280px; }
    .blob-3 { display: none; }
}

/* ديسكتوب: إطار مركزي فاخر */
@media (min-width: 768px) {
    .auth-page { align-items: center; }
    .auth-shell { max-width: 460px; }
    .auth-card {
        box-shadow:
            0 32px 80px rgba(0, 0, 0, 0.5),
            0 0 40px var(--brand-soft);
    }
    .light-mode .auth-card {
        box-shadow:
            0 24px 60px rgba(30, 33, 48, 0.12),
            0 0 40px var(--brand-soft);
    }
}
