/* ════════════════════════════════════════
   کارت نتیجه استعلام گارانتی (index.php)
   کارت سرمه‌ای + برگه جزئیات زیر آن؛ همه انیمیشن‌ها CSS است و
   با تزریق partial خودبه‌خود اجرا می‌شوند. JS فقط شمارنده و شیب ماوس.
════════════════════════════════════════ */

@property --holo { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

#result-slot { max-width: 560px; margin: 0 auto; }

/* ── رنگ وضعیت ── */
.wc          { --st: #34d399; --st-a: #6ee7b7; --st-b: #22d3ee; --st-bg: rgba(52,211,153,.14);  --st-bd: rgba(52,211,153,.38); }
.wc--pending { --st: #fbbf24; --st-a: #fde68a; --st-b: #f59e0b; --st-bg: rgba(251,191,36,.14);  --st-bd: rgba(251,191,36,.38); }
.wc--expired { --st: #fb7185; --st-a: #fda4af; --st-b: #f43f5e; --st-bg: rgba(251,113,133,.14); --st-bd: rgba(251,113,133,.38); }
.wc--void    { --st: #cbd5e1; --st-a: #e2e8f0; --st-b: #94a3b8; --st-bg: rgba(203,213,225,.12); --st-bd: rgba(203,213,225,.32); }

.wc {
    margin: 4px auto 0; text-align: right;
    animation: wcIn 1.05s cubic-bezier(.16,1,.3,1) both;
}
@keyframes wcIn {
    from { opacity: 0; transform: perspective(1400px) translateY(44px) rotateX(18deg) scale(.95); filter: blur(8px); }
    to   { opacity: 1; transform: none; filter: none; }
}
.wc [style*="--i:"] { animation: wcRise .75s calc(.38s + var(--i) * 65ms) cubic-bezier(.22,1,.36,1) both; }
@keyframes wcRise { from { opacity: 0; transform: translateY(12px); } }
@keyframes wcFade { from { opacity: 0; } }

/* ── کارت ── */
.wc-card {
    position: relative; z-index: 2; isolation: isolate; overflow: hidden;
    border-radius: 24px; padding: 22px 24px 20px; color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(56,132,255,.42) 0%, transparent 55%),
        radial-gradient(90% 80% at 0% 100%, rgba(0,86,179,.5) 0%, transparent 60%),
        linear-gradient(150deg, #0b1734 0%, #0c2150 48%, #0a2e6e 100%);
    box-shadow: 0 34px 60px -22px rgba(8,22,60,.6), 0 14px 26px -14px rgba(8,22,60,.4), inset 0 1px 0 rgba(255,255,255,.14);
    transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .7s cubic-bezier(.22,1,.36,1);
    will-change: transform;
}
.wc-card.is-tilting { transition: transform .1s linear; }
/* خطوط گیوشه (مثل اسکناس و چک) */
.wc-card::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        repeating-radial-gradient(circle at 0% 0%,   rgba(255,255,255,.07) 0 1px, transparent 1px 11px),
        repeating-radial-gradient(circle at 100% 110%, rgba(255,255,255,.05) 0 1px, transparent 1px 15px);
    -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 50%, #000 100%);
            mask-image: linear-gradient(160deg, #000 0%, transparent 50%, #000 100%);
}
/* لبه نوری */
.wc-card::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(140deg, rgba(255,255,255,.4), rgba(255,255,255,.04) 40%, rgba(255,255,255,.2));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.wc-glare {
    position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
    background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.16), transparent 45%);
}
.wc-card:hover .wc-glare { opacity: 1; }
.wc-sheen {
    position: absolute; inset: -40% -70%; z-index: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 43%, rgba(255,255,255,.26) 50%, transparent 57%);
    transform: translateX(75%);
    animation: wcSheen 1.7s 1.05s cubic-bezier(.45,0,.2,1) both;
}
@keyframes wcSheen { from { transform: translateX(75%); } to { transform: translateX(-75%); } }
.wc-card > header, .wc-main, .wc-serial { position: relative; z-index: 1; }

.wc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.wc-brand { display: flex; align-items: center; gap: 10px; }
.wc-logo {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px;
    background: linear-gradient(145deg, rgba(255,255,255,.24), rgba(255,255,255,.05));
    border: 1px solid rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.wc-brand b { display: block; font-size: 14.5px; font-weight: 800; direction: ltr; text-align: right; letter-spacing: .3px; }
.wc-brand small { display: block; font-size: 10.5px; color: rgba(255,255,255,.62); margin-top: 2px; }
.wc-status {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    padding: 6px 14px 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700;
    color: var(--st); background: var(--st-bg); border: 1px solid var(--st-bd);
}
.wc-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.wc--active .wc-status i { animation: wcPulse 2.2s 1.6s infinite; }
@keyframes wcPulse { 0% { box-shadow: 0 0 0 0 var(--st-bd); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }

.wc-main { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.wc-eyebrow { display: block; font-size: 11px; color: rgba(255,255,255,.6); margin-bottom: 6px; }
.wc-product h2 {
    font-size: 25px; font-weight: 800; color: #fff; line-height: 1.35; margin: 0 0 14px;
    unicode-bidi: plaintext; text-align: right; letter-spacing: -.2px; overflow-wrap: anywhere;
}
.wc-specs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wc-specs li {
    display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 12px; font-size: 12px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13);
}
.wc-specs i { color: #9cc7ff; font-size: 14px; }
.wc-specs span { color: rgba(255,255,255,.6); }
.wc-specs b { font-weight: 700; color: #fff; font-size: 12.5px; letter-spacing: .2px; }

.wc-ring { position: relative; width: 128px; height: 128px; flex: none; }
.wc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.wc-ring-track { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 7; }
.wc-ring-bar {
    fill: none; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 5px var(--st-bd));
    animation: wcRing 1.8s .6s cubic-bezier(.22,1,.36,1) both;
}
.wc--expired .wc-ring-bar, .wc--void .wc-ring-bar { display: none; }
@keyframes wcRing { from { stroke-dashoffset: var(--len); } }
.wc-stop-a { stop-color: var(--st-a); }
.wc-stop-b { stop-color: var(--st-b); }
.wc-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wc-ring-text b { font-size: 31px; font-weight: 800; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.wc-ring-text b.wc-word { font-size: 20px; color: var(--st); }
.wc-ring-text small { font-size: 10.5px; color: rgba(255,255,255,.65); margin-top: 7px; }

.wc-serial {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
    margin-top: 22px; padding-top: 16px; border-top: 1px dashed rgba(255,255,255,.18);
}
.wc-serial small { display: block; font-size: 10.5px; color: rgba(255,255,255,.55); margin-bottom: 5px; }
.wc-serial b {
    display: block; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 18px; font-weight: 600; letter-spacing: 2.5px; color: #fff; overflow-wrap: anywhere;
    text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
/* برچسب هولوگرام اصالت */
.wc-holo {
    flex: none; width: 46px; height: 34px; border-radius: 8px; position: relative; overflow: hidden; opacity: .9;
    background: conic-gradient(from var(--holo), #a5f3fc, #c4b5fd, #fbcfe8, #fde68a, #bbf7d0, #a5f3fc);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 4px 12px rgba(0,0,0,.3);
    animation: wcHolo 5s linear infinite;
}
.wc-holo::after {
    content: ''; position: absolute; inset: 0; mix-blend-mode: overlay;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 5px);
}
@keyframes wcHolo { to { --holo: 360deg; } }

/* ── برگه جزئیات زیر کارت ── */
.wc-sheet {
    position: relative; z-index: 1; margin: -34px 12px 0; padding: 56px 22px 20px;
    background: var(--dark-2); border: 1px solid var(--border); border-radius: 0 0 22px 22px;
    box-shadow: 0 22px 44px -22px rgba(15,35,77,.22);
}
.wc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; }
.wc-grid dt { font-size: 11px; color: var(--light-dim); margin-bottom: 5px; }
.wc-grid dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--light); }
.wc-wide { grid-column: 1 / -1; }

.wc-timeline { margin-top: 24px; padding-top: 24px; }
.wc-track { position: relative; height: 6px; border-radius: 99px; background: var(--dark-4); }
.wc-track span {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(270deg, #0056B3, #3b8cf0);
    animation: wcGrow 1.5s .85s cubic-bezier(.22,1,.36,1) both;
}
@keyframes wcGrow { from { width: 0; } }
.wc-track i {
    position: absolute; top: 50%; width: 14px; height: 14px; margin-right: -7px; border-radius: 50%;
    background: #fff; border: 3px solid var(--primary); box-sizing: border-box;
    transform: translateY(-50%); box-shadow: 0 0 0 4px var(--primary-dim);
    animation: wcFade .5s 2.1s both;
}
.wc-track i::after {
    content: 'امروز'; position: absolute; bottom: 17px; left: 50%; transform: translateX(-50%);
    font-size: 10.5px; font-style: normal; font-weight: 700; color: var(--primary); white-space: nowrap;
    background: var(--primary-dim); padding: 2px 8px; border-radius: 6px;
}
.wc--expired .wc-track span { background: linear-gradient(270deg, #e03150, #f0758a); }
.wc--expired .wc-track i { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(224,49,80,.12); }
.wc--expired .wc-track i::after { color: var(--danger); background: rgba(224,49,80,.08); }
.wc-track-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--light-dim); margin-top: 9px; }

.wc-note {
    margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; line-height: 1.8;
    background: var(--dark-3); font-size: 12.5px; color: var(--light-dim);
}

.wc-foot {
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
    display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center;
}
.wc-seal {
    width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
    color: var(--primary); background: radial-gradient(circle, #fff 56%, var(--primary-dim) 57%);
    border: 1.5px dashed rgba(0,86,179,.45);
    animation: wcStamp .65s 1.7s cubic-bezier(.2,1.5,.4,1) both;
}
@keyframes wcStamp {
    from { opacity: 0; transform: scale(1.9) rotate(-28deg); }
    to   { opacity: 1; transform: scale(1) rotate(-8deg); }
}
.wc-foot p { margin: 0; font-size: 11.5px; color: var(--light-dim); line-height: 1.7; }
.wc-foot p b { display: block; font-size: 12.5px; color: var(--light); font-weight: 700; }
.wc-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.wc-btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; padding: 10px 18px; border-radius: 12px; border: 0;
    color: #fff; background: linear-gradient(135deg, #0a3a8c, #0056B3);
    box-shadow: 0 10px 20px -10px rgba(0,86,179,.65);
    transition: transform .2s, box-shadow .2s;
}
.wc-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 24px -12px rgba(0,86,179,.75); }
.wc-btn-ghost { color: var(--light); background: var(--dark-3); box-shadow: none; }
.wc-btn-ghost:hover { background: var(--dark-4); box-shadow: none; }

/* ── یافت نشد ── */
.wc-miss {
    max-width: 520px; margin: 4px auto 0; text-align: center; padding: 30px 24px 26px;
    background: var(--dark-2); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--sh);
    animation: wcIn .9s cubic-bezier(.16,1,.3,1) both;
}
.wc-miss-icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center;
    font-size: 28px; color: var(--danger); background: rgba(224,49,80,.08);
    animation: wcShake .6s .55s both;
}
.wc-miss h2 { font-size: 17px; font-weight: 800; margin-bottom: 8px; color: var(--light); }
.wc-miss p { font-size: 13px; color: var(--light-dim); line-height: 1.95; margin-bottom: 18px; }
.wc-miss p b { color: var(--light); }
@keyframes wcShake {
    0%, 100% { transform: none; }
    20% { transform: translateX(-6px) rotate(-4deg); }
    40% { transform: translateX(5px) rotate(3deg); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
.wc-shake .check-form { animation: wcShake .5s; }

/* ── در حال استعلام ── */
.wc-loader {
    display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 22px 0 8px;
    animation: wcFade .35s both;
}
.wc-loader.is-out { animation: wcOut .26s both; }
@keyframes wcOut { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
.wc-orb { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.wc-orb::before {
    content: ''; position: absolute; inset: 20px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,86,179,.16), transparent 70%);
}
.wc-orb i { position: relative; font-size: 34px; color: var(--primary); animation: wcBreath 1.4s ease-in-out infinite; }
.wc-orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.wc-orb-ring.r1 { border-top-color: var(--primary); border-right-color: rgba(0,86,179,.22); animation: wcSpin 1.1s linear infinite; }
.wc-orb-ring.r2 { inset: 13px; border-bottom-color: #3b8cf0; border-left-color: rgba(59,140,240,.2); animation: wcSpin 1.7s linear infinite reverse; }
.wc-orb-ring.r3 { inset: -8px; border: 1px solid rgba(0,86,179,.2); animation: wcPing 1.8s ease-out infinite; }
@keyframes wcSpin  { to { transform: rotate(360deg); } }
@keyframes wcPing  { 0% { transform: scale(.85); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes wcBreath { 50% { transform: scale(1.08); } }

.wc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; min-width: 210px; }
.wc-steps li {
    display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--light-dim); opacity: .35;
    animation: wcStepOn .35s var(--d) forwards;
}
.wc-steps li::before {
    content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box;
    border: 2px solid var(--dark-5);
    animation: wcDotDone .3s calc(var(--d) + .42s) forwards;
}
@keyframes wcStepOn { to { opacity: 1; color: var(--light); } }
@keyframes wcDotDone {
    to {
        border-color: var(--success);
        background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 11px no-repeat;
    }
}

#check-submit.is-busy { opacity: .75; pointer-events: none; }
.check-form input { min-width: 0; }
@media (max-width: 400px) { .check-form .btn { padding: 9px 14px; } }

/* ── موبایل ── */
@media (max-width: 560px) {
    .wc-card { padding: 18px 16px 16px; border-radius: 20px; }
    .wc-top { margin-bottom: 18px; }
    .wc-logo { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
    .wc-brand b { font-size: 13px; }
    .wc-status { padding: 5px 11px 5px 10px; font-size: 11px; }
    /* عنوان کنار حلقه، چیپ‌های مشخصات تمام‌عرض زیرشان */
    .wc-main { grid-template-columns: 1fr auto; gap: 0 12px; align-items: start; }
    .wc-product { display: contents; }
    .wc-eyebrow { grid-column: 1; grid-row: 1; align-self: end; }
    .wc-product h2 { grid-column: 1; grid-row: 2; font-size: 21px; margin: 0; align-self: start; }
    .wc-ring { grid-column: 2; grid-row: 1 / span 2; width: 96px; height: 96px; }
    .wc-specs { grid-column: 1 / -1; grid-row: 3; margin-top: 16px; }
    .wc-ring-text b { font-size: 24px; }
    .wc-ring-text b.wc-word { font-size: 16px; }
    .wc-ring-text small { margin-top: 5px; font-size: 9.5px; }
    .wc-serial b { font-size: 15px; letter-spacing: 1.5px; }
    .wc-sheet { margin: -30px 8px 0; padding: 48px 16px 18px; border-radius: 0 0 18px 18px; }
    .wc-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .wc, .wc *, .wc *::before, .wc *::after,
    .wc-miss, .wc-miss *, .wc-loader, .wc-loader * { animation: none !important; transition: none !important; }
    .wc-steps li { opacity: 1; }
}
