/* =====================================================================
   portal-install.css — بطاقة «رفوفي على جهازك» في البوابة (S543)
   ---------------------------------------------------------------------
   نقل حرفي لطبقة النموذج المعتمد S542 (research/2026-10-app-install/
   mockup) على توكنز portal.css الحيّة (--surface · --primary · --mint…)
   وبالخصائص المنطقية كي يعمل بالاتجاهين RTL/LTR. لغة بطاقة «متجرك»:
   سطح متدرّج هادئ، حدّ رفيق، نصف قطر 16، هالة ملوّنة.
   ===================================================================== */

/* ---- البطاقة ---- */
.ac-card {
    position: relative;
    overflow: hidden;
    margin-top: 22px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--mint, #3fbf9f) 9%, var(--surface, #fff)),
        color-mix(in srgb, var(--primary, #4870d6) 9%, var(--surface, #fff)) 60%,
        var(--surface, #fff));
    border: 1px solid var(--border-strong, #dbe2f0);
    border-radius: var(--radius, 16px);
    box-shadow: var(--shadow-sm, 0 2px 10px rgba(15, 23, 42, .06));
}

.ac-grid {
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    gap: 26px;
    align-items: center;
    padding: 26px 30px;
}

.ac-halo {
    position: absolute;
    inset-block-start: auto;
    inset-inline-end: -70px;
    inset-block-end: -100px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--mint, #3fbf9f) 30%, transparent), transparent 70%);
    filter: blur(60px);
}

html.theme-dark .ac-halo { opacity: .5; }

/* --- الجهة النصّية --- */
.ac-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    color: var(--primary, #4870d6);
    background: var(--primary-soft, #eef3fd);
    border: 1px solid var(--primary-line, #c9d8f6);
    border-radius: var(--radius-pill, 999px);
    padding: 4px 12px;
}

.ac-copy h2 {
    margin: 13px 0 5px;
    font-size: 26px;
    font-weight: 800;
    color: var(--title, #16203a);
    letter-spacing: -.02em;
}

.ac-lede {
    font-size: 13.5px;
    color: var(--muted-ink, #5d6b8a);
    margin: 0 0 15px;
    max-width: 44ch;
    line-height: 1.7;
}

.ac-feats {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
}

.ac-feats li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #2a3550);
}

.ac-feats .fi {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft, #eef3fd);
    color: var(--primary, #4870d6);
}

.ac-feats .fi svg { width: 13px; height: 13px; }

/* الزرّ الأساسي — الفعل الوحيد البارز */
.ac-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 54px;
    padding: 12px 26px;
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(160deg, var(--primary, #4870d6), var(--primary-hover, #3559bd));
    box-shadow: var(--shadow-primary, 0 10px 24px color-mix(in srgb, var(--primary, #4870d6) 35%, transparent));
}

.ac-cta:hover:not([disabled]) { filter: brightness(1.05); transform: translateY(-1px); }
.ac-cta:active:not([disabled]) { transform: none; }
.ac-cta svg { width: 20px; height: 20px; }
.ac-cta[disabled] { opacity: .45; cursor: not-allowed; }

.ac-detected {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 9px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-ink, #5d6b8a);
}

.ac-detected i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint, #3fbf9f);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint, #3fbf9f) 25%, transparent);
}

/* المتجر غير جاهز — سطر انتظار تحت الزرّ المعطّل */
.ac-wait {
    margin: 8px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-ink, #5d6b8a);
}

/* حالة «مثبّت» — كبسولة نعناعية هادئة */
.ac-installed {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 22px;
    border-radius: 14px;
    background: var(--green-soft, #e8f8f1);
    border: 1px solid color-mix(in srgb, var(--mint, #3fbf9f) 45%, transparent);
    color: color-mix(in srgb, var(--mint, #3fbf9f) 65%, var(--title, #16203a));
    font-size: 15.5px;
    font-weight: 800;
}

.ac-installed .ok {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mint, #3fbf9f);
    color: #fff;
}

.ac-installed .ok svg { width: 14px; height: 14px; }

.ac-installed-sub {
    margin: 8px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted-ink, #5d6b8a);
}

.ac-reinstall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary, #4870d6);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ac-reinstall svg { width: 13px; height: 13px; }

/* صفّ «أجهزة أخرى» — tablist بالأسهم وتركيز ظاهر */
.ac-devs {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.ac-devs-label {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-ink, #5d6b8a);
}

.ac-dev {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: var(--radius-pill, 999px);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted-ink, #5d6b8a);
    background: var(--surface, #fff);
    border: 1px solid var(--border-strong, #dbe2f0);
}

.ac-dev svg { width: 15px; height: 15px; }
.ac-dev:hover { border-color: var(--primary-line, #c9d8f6); color: var(--primary, #4870d6); }
.ac-dev:focus-visible { outline: 2px solid var(--primary, #4870d6); outline-offset: 2px; }
.ac-dev[aria-selected="true"],
.ac-dev[aria-current="true"] {
    color: var(--primary, #4870d6);
    background: var(--primary-soft, #eef3fd);
    border-color: var(--primary-line, #c9d8f6);
}

.ac-tick {
    display: inline-flex;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--mint, #3fbf9f);
    color: #fff;
}

.ac-tick svg { width: 9px; height: 9px; }

/* --- المشهد البصري: لابتوب + جوال بلقطات البرنامج --- */
.ac-stage {
    position: relative;
    min-height: 300px;
}

.ac-shot {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: top;
    background: #fff;
}

.ac-laptop {
    position: absolute;
    inset-inline-start: 6px;
    top: 12px;
    width: min(78%, 400px);
    animation: ac-float 8s ease-in-out infinite alternate;
}

.ac-laptop .ac-screen {
    border: 1px solid var(--border-strong, #dbe2f0);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface, #fff);
    box-shadow: var(--shadow, 0 18px 50px rgba(15, 23, 42, .18));
}

.ac-laptop .ac-shot {
    aspect-ratio: 1280 / 800;
    height: auto;
    border-radius: 11px 11px 0 0;
}

.ac-laptop .ac-deck {
    height: 11px;
    margin: 0 -16px;
    border-radius: 3px 3px 8px 8px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--title, #16203a) 26%, var(--surface-2, #f2f5fb)),
        color-mix(in srgb, var(--title, #16203a) 40%, var(--surface-2, #f2f5fb)));
}

.ac-phone {
    position: absolute;
    inset-inline-end: 2px;
    bottom: 0;
    width: 128px;
    border: 5px solid color-mix(in srgb, var(--title, #16203a) 55%, var(--surface-2, #f2f5fb));
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow, 0 18px 50px rgba(15, 23, 42, .18));
    animation: ac-float 8s ease-in-out 1.2s infinite alternate;
}

/* مشهد الجوال وحده (حالتا iPhone/Android): جوال أكبر في المنتصف كالنموذج،
   لا موضعه المطلق عند حافة مشهد اللابتوب. */
.ac-stage-solo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ac-stage-solo .ac-phone {
    position: relative;
    inset-inline-end: auto;
    bottom: auto;
    width: 190px;
}

.ac-phone .ac-shot {
    aspect-ratio: 1080 / 2000;
    height: auto;
    border-radius: 18px 18px 0 0;
}

@keyframes ac-float {
    from { transform: translateY(0); }
    to { transform: translateY(-7px); }
}

@media (prefers-reduced-motion: reduce) {
    .ac-laptop,
    .ac-phone { animation: none; }
}

/* حالة QR — إطار جوّالي صغير يحتضن الماسح */
.ac-qr-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 280px;
}

.ac-qr-phone {
    width: 218px;
    padding: 16px 16px 14px;
    text-align: center;
    border: 5px solid color-mix(in srgb, var(--title, #16203a) 55%, var(--surface-2, #f2f5fb));
    border-radius: 30px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow, 0 18px 50px rgba(15, 23, 42, .18));
}

.ac-qr-phone img {
    display: block;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border, #eef1f7);
    background: #fff;
}

.ac-qr-phone figcaption {
    margin-top: 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted-ink, #5d6b8a);
}

.ac-qr-note {
    margin: 0 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted-ink, #5d6b8a);
}

/* لوحة «من جوال إلى كمبيوتر» */
.ac-cross-line {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #2a3550);
}

.ac-cross-link {
    display: inline-block;
    max-width: 100%;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px dashed var(--border-strong, #dbe2f0);
    background: var(--surface, #fff);
    font: inherit;
    font-size: 12.5px;
    color: var(--primary, #4870d6);
    cursor: copy;
    overflow-wrap: anywhere;
}

/* --- خطوات مصوّرة (Mac / iPhone) --- */
.ac-steps {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.ac-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #eef1f7);
    border-radius: var(--radius-sm, 10px);
}

.ac-steps .ac-step-n {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #4870d6);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.ac-steps .ac-step-ic {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft, #eef3fd);
    color: var(--primary, #4870d6);
}

.ac-steps .ac-step-ic svg { width: 20px; height: 20px; }

.ac-steps b {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--title, #16203a);
}

.ac-steps span {
    font-size: 12px;
    color: var(--muted-ink, #5d6b8a);
}

/* ===================== تجاوب البطاقة =====================
   نقطة الشبكة 2×2 للخانات مربوطة بعرض البطاقة (container query) لا
   بالنافذة — ملاحظة تنفيذية من مراجعة S542. */
.ac-card { container-type: inline-size; }

@container (max-width: 640px) {
    .ac-grid {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 20px 18px;
    }

    .ac-stage { order: -1; min-height: 250px; }
    .ac-copy h2 { font-size: 22px; }
    .ac-cta { width: 100%; }
    .ac-devs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .ac-devs-label { grid-column: 1 / -1; }
    .ac-dev { justify-content: center; }
}

/* احتياط للمتصفّحات بلا container queries: نفس القواعد بعرض النافذة */
@supports not (container-type: inline-size) {
    @media (max-width: 640px) {
        .ac-grid { grid-template-columns: 1fr; padding: 20px 18px; }
        .ac-stage { order: -1; }
        .ac-cta { width: 100%; }
        .ac-devs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .ac-devs-label { grid-column: 1 / -1; }
    }
}
