/* الصفحة العامة لنماذج البطاقات */
.cp-body { background: var(--bg); color: var(--text); min-height: 100dvh; }
.cp-wrap { width: min(1180px, 100%); margin-inline: auto; padding-inline: 16px; }
.cp-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.cp-nav-in { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.cp-brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; margin-inline-end: auto; } .cp-brand img { height: 34px; width: auto; display: block; }
.cp-lang { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--surface-2); }
.cp-lang a { padding: 7px 12px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 99px; font-size: .84rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.cp-lang a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(16 24 40 / .14); }
.cp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation; transition: transform .12s, filter .15s; }
.cp-btn svg { fill: currentColor; stroke: none; } @media (hover: hover) { .cp-btn:hover { filter: brightness(1.1); } } .cp-btn:active { transform: scale(.98); } .cp-btn:disabled { opacity: .6; cursor: progress; }
.cp-btn.alt { background: var(--surface-2); color: var(--text); }
.cp-btn:focus-visible, .cp-filter button:focus-visible, .cp-lang a:focus-visible, .cp-link:focus-visible, .cp-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cp-nav-cta { min-height: 42px; padding-inline: 16px; font-size: .9rem; }

.cp-hero { padding: 44px 0 22px; text-align: center; }
.cp-hero h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.2; letter-spacing: -.01em; }
.cp-hero p { max-width: 620px; margin: 12px auto 8px; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.15rem); line-height: 1.6; }
.cp-hero small { color: var(--muted); font-size: .84rem; }
.cp-filter { display: flex; justify-content: center; gap: 6px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; } .cp-filter::-webkit-scrollbar { display: none; }
.cp-filter button { flex: none; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.cp-filter button[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.cp-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); content-visibility: auto; contain-intrinsic-size: auto 680px; } .cp-card[hidden] { display: none; }
.cp-stage { flex: 1; display: flex; align-items: center; padding: 24px; background: linear-gradient(160deg, color-mix(in srgb, var(--cm) 22%, var(--surface)), color-mix(in srgb, var(--cm) 6%, var(--surface))); }
.cp-stage .wpass, .cp-slot .wpass { width: 100%; margin: 0 auto; }
.cp-stage .wpass { pointer-events: none; box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--cm) 75%, #000); }
.cp-body > .cp-body, .cp-card .cp-body { display: grid; gap: 10px; padding: 16px 18px 18px; min-height: 0; background: none; }
.cp-card h2 { margin: 0; font-size: 1.1rem; } .cp-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.cp-fit { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; } .cp-fit li { padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.cp-end { margin: 36px 0 48px; padding: 32px 20px; text-align: center; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); } .cp-end h2 { margin: 0 0 6px; } .cp-end p { margin: 0 0 16px; color: var(--muted); }

.cp-dlg { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 26px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
.cp-dlg::backdrop { background: rgb(10 16 30 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cp-dlg-in { position: relative; display: grid; gap: 12px; padding: 16px; }
.cp-dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .cp-dlg-h h2 { margin: 0; font-size: 1.05rem; }
.cp-x { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; }
.cp-note { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); box-shadow: 0 8px 24px -12px rgb(16 24 40 / .4); animation: cpNote .35s cubic-bezier(.2, .9, .3, 1.2); } .cp-note[hidden] { display: none; }
.cp-note-ic { font-size: 1.25rem; } .cp-note b { display: block; font-size: .82rem; } .cp-note span:not(.cp-note-ic) { font-size: .88rem; line-height: 1.4; } .cp-note small { align-self: start; color: var(--muted); font-size: .72rem; }
.cp-slot { position: relative; min-height: 200px; }
.cp-acts { display: grid; gap: 8px; } .cp-acts .cp-btn { width: 100%; min-height: 54px; font-size: 1.02rem; }
.cp-over { margin: 0; padding: 12px; text-align: center; color: var(--muted); border-radius: 14px; background: var(--surface-2); }
.cp-err { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-size: .88rem; } .cp-err[hidden] { display: none; }
.cp-dlg-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer; } .cp-link.strong { color: var(--primary); font-weight: 700; }
.cp-dlg-hint { text-align: center; color: var(--muted); font-size: .76rem; }
.cp-pop { animation: cpPop .5s cubic-bezier(.2, .9, .3, 1.5); }
.cp-conf { position: absolute; inset: 0; pointer-events: none; overflow: visible; display: grid; place-items: center; } .cp-conf i { position: absolute; width: 9px; height: 9px; border-radius: 2px; opacity: 0; animation: cpConf 1.2s cubic-bezier(.15, .7, .3, 1) var(--d) forwards; }
@keyframes cpNote { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes cpPop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } }
@keyframes cpConf { 0% { opacity: 1; transform: translate(0, 40px) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }
@media (max-width: 640px) {
  .cp-nav-cta { display: none; } .cp-lang a { padding-inline: 10px; font-size: .8rem; } .cp-hero { padding-top: 28px; } .cp-filter { justify-content: flex-start; }
  .cp-dlg { width: 100vw; max-width: none; margin: auto 0 0; max-height: 92dvh; border-radius: 26px 26px 0 0; } .cp-dlg-in { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .cp-note, .cp-pop { animation: none; } .cp-btn { transition: none; } }
