/* [مسح الـ Access Key] زرار النص في الشريط اللي تحت + شاشة الكاميرا (js/gs-scan.js) */

/* ---------------------------------------------------------------- زرار النص في الشريط اللي تحت */
.gs-bn-scan { flex: 0 0 70px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 52px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--gs-red) !important; font-size: 10.5px; font-weight: 800; line-height: 1.2; -webkit-tap-highlight-color: transparent; }
.gs-bn-scan-btn { position: absolute; top: -26px; left: 50%; width: 58px; height: 58px; margin-left: -29px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 23px;
    background: radial-gradient(circle at 30% 25%, #ff5a63, #bc1823 62%, #8f0f18); border: 4px solid #fff;
    box-shadow: 0 10px 22px rgba(188, 24, 35, .42), 0 2px 0 rgba(255, 255, 255, .35) inset; transition: transform .2s cubic-bezier(.2, .8, .2, 1.3); }
.gs-bn-scan-btn::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(188, 24, 35, .35); animation: gsScanPulse 2.6s ease-out infinite; pointer-events: none; }
.gs-bn-scan:active .gs-bn-scan-btn { transform: scale(.92); }
.gs-bn-scan span { white-space: nowrap; }
@keyframes gsScanPulse { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.35); opacity: 0; } }

/* ---------------------------------------------------------------- الشاشة */
.gs-scan { position: fixed; inset: 0; z-index: 2000; background: #0b0c0f; color: #fff; display: flex; flex-direction: column; overflow: hidden; touch-action: manipulation;
    transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); font-family: inherit; }
.gs-scan.is-open { transform: none; }
.gs-scan-lock { overflow: hidden !important; }
.gs-scan video, .gs-scan-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gs-scan-bg { background: radial-gradient(420px 320px at 75% 15%, rgba(188, 24, 35, .45), transparent 65%), linear-gradient(165deg, #22252c, #0b0c0f); }
.gs-scan-shade { position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .7) 0, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, .78) 100%); }

/* فوق */
.gs-scan-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px; }
.gs-scan-ib { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.gs-scan-ib.is-on { background: #fff; color: #111; }
.gs-scan-ib[hidden] { display: none; }
.gs-scan-tt { flex: 1; min-width: 0; text-align: center; }
.gs-scan-tt b { display: block; font-size: 16px; font-weight: 800; }
.gs-scan-tt small { display: block; font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* الإطار */
.gs-scan-mid { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; justify-content: center; }
.gs-scan-frame { position: relative; width: min(66vw, 280px); aspect-ratio: 1; border-radius: 26px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .38); transition: transform .3s cubic-bezier(.2, .8, .2, 1.3), box-shadow .3s; }
.gs-scan-frame i { position: absolute; width: 42px; height: 42px; border: 4px solid #fff; transition: border-color .2s; }
.gs-scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 24px; }
.gs-scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 24px; }
.gs-scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 24px; }
.gs-scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 24px; }
.gs-scan-laser { position: absolute; left: 14px; right: 14px; top: 50%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #ff4d57, transparent); box-shadow: 0 0 18px 2px rgba(255, 77, 87, .7); animation: gsScanLaser 2.4s ease-in-out infinite; }
@keyframes gsScanLaser { 0%, 100% { transform: translateY(-95px); } 50% { transform: translateY(95px); } }
.gs-scan.is-hit .gs-scan-frame { transform: scale(.94); }
.gs-scan.is-hit .gs-scan-frame i { border-color: #4ade80; }
.gs-scan.is-paused .gs-scan-laser, .gs-scan.is-hit .gs-scan-laser { opacity: 0; }
.gs-scan-hint { position: absolute; left: 0; right: 0; top: calc(100% + 18px); text-align: center; font-size: 13.5px; font-weight: 700; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }

/* NFC */
.gs-scan-nfc { display: none; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 0 30px; }
.gs-scan-nfc-ic { position: relative; width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center; font-size: 44px; color: #ff7a82; }
.gs-scan-nfc-ic::before, .gs-scan-nfc-ic::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 122, 130, .5); animation: gsScanPulse 2.2s ease-out infinite; }
.gs-scan-nfc-ic::after { animation-delay: 1.1s; }
.gs-scan-nfc b { font-size: 18px; }
.gs-scan-nfc small { font-size: 13.5px; opacity: .7; line-height: 1.6; }
.gs-scan[data-mode="nfc"] .gs-scan-frame, .gs-scan[data-mode="code"] .gs-scan-frame { display: none; }
.gs-scan[data-mode="nfc"] .gs-scan-nfc { display: flex; }

/* كتابة الكود */
.gs-scan-code { display: none; width: min(88vw, 360px); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px; padding: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.gs-scan[data-mode="code"] .gs-scan-code { display: block; }
.gs-scan-code label { display: block; font-size: 13px; font-weight: 700; opacity: .8; margin-bottom: 8px; }
.gs-scan-code input { width: 100%; height: 50px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .3); color: #fff; font: inherit; font-size: 15px; padding: 0 14px; direction: ltr; text-align: left; outline: 0; }
.gs-scan-code input:focus { border-color: #ff7a82; box-shadow: 0 0 0 3px rgba(255, 77, 87, .25); }
.gs-scan-code button { margin-top: 10px; width: 100%; height: 48px; border-radius: 14px; border: 0; background: var(--gs-red, #bc1823); color: #fff; font: inherit; font-weight: 800; font-size: 15px; }

/* تحت */
.gs-scan-bottom { position: relative; z-index: 3; padding: 0 14px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; }
.gs-scan-today { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255, 255, 255, .78); background: rgba(0, 0, 0, .45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 9px 12px; border-radius: 14px; min-height: 38px; }
.gs-scan-today b { color: #fff; font-size: 14px; }
.gs-scan-today i.dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .4); }
.gs-scan-modes { display: flex; gap: 6px; background: rgba(255, 255, 255, .12); border-radius: 18px; padding: 5px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.gs-scan-modes button { flex: 1; height: 42px; border: 0; border-radius: 14px; background: none; color: rgba(255, 255, 255, .78); font: inherit; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.gs-scan-modes button.is-on { background: #fff; color: #111; }
.gs-scan-modes button[hidden] { display: none; }

/* رسالة صغيرة فوق */
.gs-scan-toast { position: absolute; z-index: 5; top: calc(70px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -12px); opacity: 0; transition: .25s; background: rgba(17, 17, 17, .88); color: #fff; font-size: 13.5px; font-weight: 700; padding: 10px 16px; border-radius: 14px; max-width: 86vw; text-align: center; pointer-events: none; }
.gs-scan-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* الكاميرا مش متاحة */
.gs-scan-err { display: none; width: min(88vw, 360px); text-align: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 22px; padding: 22px 18px; }
.gs-scan.is-err[data-mode="camera"] .gs-scan-err { display: block; }
.gs-scan.is-err[data-mode="camera"] .gs-scan-frame { display: none; }
.gs-scan-err .fa { font-size: 30px; color: #ff7a82; margin-bottom: 10px; }
.gs-scan-err b { display: block; font-size: 16px; margin-bottom: 6px; }
.gs-scan-err small { display: block; font-size: 13px; opacity: .72; line-height: 1.6; }

/* ---------------------------------------------------------------- كارت النتيجة */
.gs-scan-sheet { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; background: #fff; color: #111; border-radius: 26px 26px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -20px 50px rgba(0, 0, 0, .45); transform: translateY(105%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); max-height: 86vh; overflow: auto; }
.gs-scan-sheet.is-on { transform: none; }
.gs-scan-grab { width: 44px; height: 5px; border-radius: 5px; background: #d6d9df; margin: 0 auto 12px; }
.gs-scan-st { text-align: center; margin-bottom: 14px; }
.gs-scan-st b { display: block; font-size: 19px; font-weight: 800; margin-top: 10px; line-height: 1.35; }
.gs-scan-st small { display: block; font-size: 13px; color: #6b7280; margin-top: 2px; }
.gs-scan-ring { display: inline-flex; width: 66px; height: 66px; border-radius: 50%; align-items: center; justify-content: center; font-size: 28px; animation: gsScanPop .45s cubic-bezier(.2, .8, .2, 1.4) both; }
@keyframes gsScanPop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.is-ok .gs-scan-ring { background: #e7f8ee; color: #16a34a; box-shadow: 0 0 0 8px rgba(22, 163, 74, .09); }
.is-amber .gs-scan-ring { background: #fff4e0; color: #d97706; box-shadow: 0 0 0 8px rgba(217, 119, 6, .09); }
.is-red .gs-scan-ring { background: #fdecee; color: #bc1823; box-shadow: 0 0 0 8px rgba(188, 24, 35, .09); }
.is-blue .gs-scan-ring { background: #e8f0fe; color: #2563eb; box-shadow: 0 0 0 8px rgba(37, 99, 235, .09); }
.gs-scan-who { display: flex; align-items: center; gap: 12px; background: #f6f7f9; border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.gs-scan-av { flex: 0 0 auto; position: relative; width: 46px; height: 46px; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #bc1823, #ff6b73); color: #fff; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.gs-scan-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gs-scan-who > div { flex: 1; min-width: 0; }
.gs-scan-who b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-scan-who small { display: block; font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-scan-pill { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; }
.gs-scan-pill.g { background: #e7f8ee; color: #16a34a; } .gs-scan-pill.r { background: #fdecee; color: #bc1823; } .gs-scan-pill.b { background: #e8f0fe; color: #2563eb; } .gs-scan-pill.a { background: #fff4e0; color: #b45309; }
.gs-scan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.gs-scan-grid > div { border: 1px solid #e7e9ee; border-radius: 13px; padding: 8px 6px; text-align: center; min-width: 0; }
.gs-scan-grid small { display: block; font-size: 11px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-scan-grid b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-scan-grid b em { font-style: normal; color: #9aa0a8; font-size: 11.5px; font-weight: 700; }
.gs-scan-grid .is-warn { background: #fff7ed; border-color: #fed7aa; } .gs-scan-grid .is-warn b { color: #c2410c; }
.gs-scan-grid .is-low b { color: #bc1823; }
.gs-scan-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; }
.gs-scan-meta span { font-size: 12px; font-weight: 700; color: #4b5563; background: #f6f7f9; border-radius: 99px; padding: 5px 10px; }
.gs-scan-meta .fa { color: #bc1823; margin-inline-end: 4px; }
.gs-scan-go { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 13.5px; color: #4b5563; background: #f6f7f9; border-radius: 14px; padding: 12px; margin-bottom: 12px; text-align: center; }
.gs-scan-spin { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #e5e7eb; border-top-color: #bc1823; animation: gsScanSpin .8s linear infinite; }
@keyframes gsScanSpin { to { transform: rotate(360deg); } }
.gs-scan-acts { display: flex; gap: 8px; }
.gs-scan-acts button { flex: 1; min-width: 0; height: 50px; border-radius: 15px; border: 0; font: inherit; font-weight: 800; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.gs-scan-acts .is-ghost { background: #f1f2f4; color: #111; }
.gs-scan-acts .is-main { background: #bc1823; color: #fff; box-shadow: 0 10px 22px rgba(188, 24, 35, .28); }
.gs-scan-acts .is-main:disabled, .gs-scan-acts .is-ghost:disabled { opacity: .55; }
.gs-scan-cd { min-width: 26px; height: 26px; border-radius: 99px; background: rgba(255, 255, 255, .22); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.gs-scan-acts button:focus { outline: 0; }
.gs-scan-acts button:focus-visible { outline: 3px solid rgba(188, 24, 35, .35); outline-offset: 2px; }

@media (min-width: 992px) {
    .gs-scan-sheet { left: 50%; right: auto; width: 440px; margin-left: -220px; border-radius: 26px; bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .gs-scan, .gs-scan-sheet { transition: none; }
    .gs-scan-laser, .gs-bn-scan-btn::after, .gs-scan-nfc-ic::before, .gs-scan-nfc-ic::after { animation: none; }
}
.gs-scan-err-code { display: block; font-style: normal; font-size: 11px; opacity: .45; margin-top: 6px; direction: ltr; }
.gs-scan-retry { margin-top: 14px; height: 44px; padding: 0 20px; border-radius: 14px; border: 0; background: #fff; color: #111; font: inherit; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }

/* [أكتر من اشتراك] اختيار الاشتراك بضغطة */
.gs-scan-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gs-scan-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: start; padding: 12px 14px; border: 1px solid #e3e6eb; border-radius: 14px; background: #fff; cursor: pointer; }
.gs-scan-opt:hover:not(:disabled) { border-color: #bc1823; }
.gs-scan-opt.is-sug { border: 2px solid #bc1823; background: #fff7f7; }
.gs-scan-opt:disabled { opacity: .55; cursor: default; }
.gs-scan-opt span { min-width: 0; }
.gs-scan-opt b { display: block; font-size: 14.5px; color: #111827; }
.gs-scan-opt small { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
.gs-scan-opt em { flex: 0 0 auto; font-style: normal; font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 3px 9px; }
.gs-scan-opt em.is-sug { color: #bc1823; background: #fdecec; }
.gs-scan-opt em.is-ok { color: #15803d; background: #e8f7ee; }
.gs-scan-opt em.is-fz { color: #0369a1; background: #e6f3fb; }
.gs-scan-opt-e { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.gs-scan-opt-go { color: #bc1823; font-size: 18px; }
.gs-scan-opt .fa-repeat.gs-scan-opt-go { font-size: 13px; color: #6b7280; }

/* [إعدادات الباقة] تنبيهات الحضور: قرب يخلص (أيام / حصص) + عليه فلوس */
.gs-scan-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.gs-scan-alerts span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; background: #fff4e0; color: #b45309; font-size: 13px; font-weight: 700; border: 1px solid #fde2b8; }
.gs-scan-alerts .fa { font-size: 13px; }
