/* Badges, registry cards, search, modals, the viewer, toasts, empty state, footer
   Moved out of styles.css on 2026-11-05 (one big file split by section; the rules are unchanged and in the same order).
   Every page links this file right after css/widgets.css. */

/* ─── BADGES ─── */
.bdg { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.bdg-gold   { background: rgba(212, 160, 23, 0.12); color: var(--gold); border: 1px solid rgba(212, 160, 23, 0.25); }
.bdg-blue   { background: rgba(59, 130, 246, 0.12); color: #60a5fa;    border: 1px solid rgba(59, 130, 246, 0.25); }
.bdg-purple { background: rgba(139, 92, 246, 0.12); color: #a78bfa;    border: 1px solid rgba(139, 92, 246, 0.25); }
.bdg-red    { background: rgba(239, 68, 68, 0.12);  color: #f87171;    border: 1px solid rgba(239, 68, 68, 0.25); }
.bdg-green  { background: rgba(34, 197, 94, 0.12);  color: #4ade80;    border: 1px solid rgba(34, 197, 94, 0.25); }

/* ─── REGISTRY CARDS ─── */
.reg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .reg-grid { grid-template-columns: 1fr 1fr; } }

@media (max-width: 560px) { .reg-grid { grid-template-columns: 1fr; } }

.reg-card {
  background: var(--card);
  border: 1px solid var(--b1);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.reg-top { padding: 16px; border-bottom: 1px solid var(--b1); display: flex; align-items: center; gap: 12px; }
.reg-ava { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--s); flex-shrink: 0; }
.reg-name { font-size: 14px; font-weight: 800; color: var(--t1); }
.reg-meta { margin-top: 4px; }
.reg-check { margin-right: auto; color: var(--green); font-size: 16px; }
.reg-rows { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.reg-row { display: flex; justify-content: space-between; font-size: 12px; }
.reg-row .lbl { color: var(--t2); }
.reg-row .val { color: var(--t1); font-weight: 600; }

/* Search Box */
.srch-wrap { position: relative; width: 100%; max-width: 300px; }
.srch-wrap i { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--t3); font-size: 13px; pointer-events: none; }
.srch-wrap input { background: var(--s); border: 1px solid var(--b2); border-radius: 8px; color: var(--t1); padding: 10px 36px 10px 14px; font-size: 13px; width: 100%; }
.srch-wrap input:focus { border-color: var(--gold); outline: none; }

/* ─── MODALS ─── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border: 1px solid var(--b2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.modal-wide { max-width: 840px; }
.modal-hdr {
  padding: 16px 20px;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 800; color: var(--t1); display: flex; align-items: center; gap: 8px; }

.modal-x {
  background: transparent;
  border: none;
  color: var(--t3);
  font-size: 18px;
  padding: 2px;
  cursor: pointer;
  transition: color .15s;
}
.modal-x:hover { color: var(--t1); }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--b1);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Side by Side ID Inspection */
.id-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 580px) { .id-pair { grid-template-columns: 1fr; } }

.id-box {
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  position: relative;
  border: 1px solid var(--b2);
}
.id-box img { width: 100%; height: 200px; object-fit: cover; cursor: zoom-in; display: block; }
.id-lbl {
  position: absolute;
  bottom: 0;
  inset-x: 0;
  padding: 6px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Details Grid */
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 500px) { .det-grid { grid-template-columns: 1fr; } }

.det-item { background: var(--s); border: 1px solid var(--b1); border-radius: 8px; padding: 10px 12px; }
.det-lbl { font-size: 10px; color: var(--t3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.det-val { font-size: 13px; font-weight: 700; color: var(--t1); margin-top: 2px; }
.det-val.acc { color: var(--gold); }

/* Hint Box */
.hint-box {
  background: rgba(212, 160, 23, 0.07);
  border: 1px solid rgba(212, 160, 23, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--t2);
}
.hint-box b { color: var(--gold); }

/* ─── FULLSCREEN VIEWER ─── */
#fsv {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
#fsv img { max-width: 100%; max-height: 90vh; border-radius: 10px; object-fit: contain; }
.fsv-x {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* ─── TOAST NOTIFICATIONS ─── */
#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--b2);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  min-width: 260px;
  max-width: 340px;
  animation: tin .22s ease;
}
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.toast i { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--t1); }
.toast-msg { font-size: 12px; color: var(--t2); }
@media (max-width: 460px) { #toasts { left: 10px; right: 10px; bottom: 10px; } .toast { min-width: 0; max-width: 100%; } }

/* ─── «فيه نسخة جديدة من الموقع» (js/live-update.js): shown only when the page could not refresh by itself ─── */
.lup-bar { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 998; display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 16px; background: var(--card); color: var(--t1); border: 1px solid rgba(212, 160, 23, 0.45); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 14px; font-weight: 700; max-width: calc(100vw - 24px); animation: lupIn .3s ease-out; }
.lup-bar[hidden] { display: none; }
.lup-bar > i { color: var(--gold); }
.lup-x { background: none; border: 0; color: var(--t3); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.lup-x:hover, .lup-x:focus-visible { color: var(--t1); }
@keyframes lupIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 460px) {
  .lup-bar { left: 10px; right: 10px; bottom: 10px; transform: none; animation: none; }
  .lup-text { flex: 1; }
}

/* Desktop-only toast design (phones keep the compact default above) */
@keyframes toastLife { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (min-width: 769px) {
  #toasts {
    top: 24px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    align-items: center;
    pointer-events: none;
  }
  .toast {
    --toast-accent: var(--blue);
    position: relative;
    overflow: hidden;
    align-items: center;
    gap: 14px;
    min-width: 360px;
    max-width: 480px;
    padding: 14px 20px 17px;
    border-radius: 14px;
    background: rgba(22, 22, 28, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-inline-start: 4px solid var(--toast-accent);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.75), 0 0 24px color-mix(in srgb, var(--toast-accent) 18%, transparent);
    pointer-events: auto;
    animation: tin .25s ease;
  }
  .toast-success { --toast-accent: var(--green); }
  .toast-danger  { --toast-accent: var(--red); }
  .toast-warning { --toast-accent: var(--gold); }
  .toast-info    { --toast-accent: var(--blue); }
  .toast > i {
    width: 38px;
    height: 38px;
    margin-top: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: color-mix(in srgb, var(--toast-accent) 16%, transparent);
  }
  .toast-title { font-size: 14.5px; font-weight: 800; }
  .toast-msg { font-size: 12.5px; margin-top: 2px; line-height: 1.5; }
  /* Countdown bar showing how long the message stays */
  .toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--toast-accent);
    transform-origin: right;
    animation: toastLife 4s linear forwards;
  }
}

/* ─── EMPTY STATE ─── */
.empty { text-align: center; padding: 48px 16px; color: var(--t3); }
.empty i { font-size: 32px; margin-bottom: 12px; display: block; }
.empty p { font-size: 14px; }

/* (profile page styles: see "PROFILE PAGE" at the end of this file) */

/* ─── FOOTER ─── */
footer {
  background: var(--s);
  border-top: 1px solid var(--b1);
  padding: 22px 0;
  text-align: center;
  font-size: 12px;
  color: var(--t3);
}
footer strong { color: var(--gold); }

/* ─── NETLIFY BADGE & INJECTED WIDGETS ───
   Only direct children of <body>, where Netlify injects them (same rule as eliminateNetlifyBadge in js/main.js).
   These selectors used to match anywhere on the page, and the site's own address is "...netlify.app": the QR card
   of the identity step carries that link in its title, so the whole QR was hidden on the live site. */
body > [data-netlify-identity-button],
body > .netlify-identity-button,
body > #netlify-identity-widget,
body > .netlify-badge,
body > #netlify-badge,
body > .netlify-drawer,
body > [class*="netlify" i],
body > [id*="netlify" i],
body > [aria-label*="netlify" i],
body > [title*="netlify" i],
body > a[href*="netlify.com" i],
body > a[href*="netlify.app" i],
body > img[src*="netlify" i],
body > iframe[src*="netlify" i],
body > div:has(> a[href*="netlify"]),
body > div:has(> [class*="netlify"]),
body > div[style*="fixed"][style*="bottom"],
body > div[style*="fixed"][style*="right: 0"],
body > div[style*="fixed"][style*="left: 0"],
body > a[style*="fixed"][style*="bottom"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  top: -99999px !important;
  left: -99999px !important;
  z-index: -99999 !important;
}

/* egl:start */
/* egl:logo img/logo-login.png outline 6,34 250,34 127.5,244 */
/* ─── loading animation: the site logo comes apart and back together (built by E:/EGY-NOTES/tools/loader/build-preview.js;
   do not edit by hand). js/loader.js logoLoader(size) draws it. The box and its pieces set their own size / margin / display
   (with !important on the box) so the boxes it sits in (.empty i, .pr-item span ...) cannot bend it. ─── */
.egl { position: relative !important; display: inline-block !important; width: var(--egl-size, 48px) !important; height: var(--egl-size, 48px) !important;
  font-size: 0 !important; line-height: 0 !important; margin: 0; padding: 0; flex: none; vertical-align: middle; }
.egl > .egl-p, .egl > .egl-base { position: absolute; inset: 0; margin: 0; padding: 0; display: block; font-size: 0; width: auto; height: auto;
  background: url('../img/logo-login.png') center / 100% 100% no-repeat; will-change: transform, opacity; }
.egl > .egl-base { clip-path: polygon(2.34% 13.28%, 97.66% 13.28%, 49.8% 95.31%); animation: egl-base 2.6s linear infinite; }
.egl > .egl-p { opacity: 0; animation: egl-break 2.6s cubic-bezier(.62, 0, .3, 1) infinite; }
.egl > .egl-p:nth-child(1) { clip-path: polygon(2.34% 13.28%, 26.17% 13.28%, 14.21% 33.79%); transform-origin: 14.24% 20.12%; --tx: -10.4%; --ty: -5.98%; --rot: -8deg; animation-delay: 0.09s; }
.egl > .egl-p:nth-child(2) { clip-path: polygon(26.17% 13.28%, 50% 13.28%, 38.04% 33.79%); transform-origin: 38.07% 20.12%; --tx: -4.52%; --ty: -7.81%; --rot: 13deg; animation-delay: 0.05s; }
.egl > .egl-p:nth-child(3) { clip-path: polygon(14.21% 33.79%, 38.04% 33.79%, 26.07% 54.3%); transform-origin: 26.11% 40.63%; --tx: -9.05%; --ty: 0%; --rot: -18deg; animation-delay: 0.05s; }
.egl > .egl-p:nth-child(4) { clip-path: polygon(26.17% 13.28%, 38.04% 33.79%, 14.21% 33.79%); transform-origin: 26.14% 26.95%; --tx: -8.38%; --ty: -4.82%; --rot: 10deg; animation-delay: 0.06s; }
.egl > .egl-p:nth-child(5) { clip-path: polygon(50% 13.28%, 73.83% 13.28%, 61.87% 33.79%); transform-origin: 61.9% 20.12%; --tx: 4.55%; --ty: -7.81%; --rot: -15deg; animation-delay: 0.05s; }
.egl > .egl-p:nth-child(6) { clip-path: polygon(73.83% 13.28%, 97.66% 13.28%, 85.69% 33.79%); transform-origin: 85.73% 20.12%; --tx: 10.42%; --ty: -5.97%; --rot: 20deg; animation-delay: 0.09s; }
.egl > .egl-p:nth-child(7) { clip-path: polygon(61.87% 33.79%, 85.69% 33.79%, 73.73% 54.3%); transform-origin: 73.76% 40.63%; --tx: 9.05%; --ty: 0%; --rot: -12deg; animation-delay: 0.05s; }
.egl > .egl-p:nth-child(8) { clip-path: polygon(73.83% 13.28%, 85.69% 33.79%, 61.87% 33.79%); transform-origin: 73.8% 26.95%; --tx: 8.39%; --ty: -4.81%; --rot: 17deg; animation-delay: 0.06s; }
.egl > .egl-p:nth-child(9) { clip-path: polygon(26.07% 54.3%, 49.9% 54.3%, 37.94% 74.8%); transform-origin: 37.97% 61.13%; --tx: -4.55%; --ty: 7.81%; --rot: -9deg; animation-delay: 0.05s; }
.egl > .egl-p:nth-child(10) { clip-path: polygon(49.9% 54.3%, 73.73% 54.3%, 61.77% 74.8%); transform-origin: 61.8% 61.13%; --tx: 4.52%; --ty: 7.81%; --rot: 14deg; animation-delay: 0.05s; }
.egl > .egl-p:nth-child(11) { clip-path: polygon(37.94% 74.8%, 61.77% 74.8%, 49.8% 95.31%); transform-origin: 49.84% 81.64%; --tx: -0.03%; --ty: 11.97%; --rot: -19deg; animation-delay: 0.09s; }
.egl > .egl-p:nth-child(12) { clip-path: polygon(49.9% 54.3%, 61.77% 74.8%, 37.94% 74.8%); transform-origin: 49.87% 67.97%; --tx: -0.02%; --ty: 9.65%; --rot: 11deg; animation-delay: 0.06s; }
.egl > .egl-p:nth-child(13) { clip-path: polygon(50% 13.28%, 61.87% 33.79%, 38.04% 33.79%); transform-origin: 49.97% 26.95%; --tx: 0.02%; --ty: -7.32%; --rot: -16deg; animation-delay: 0.03s; }
.egl > .egl-p:nth-child(14) { clip-path: polygon(61.87% 33.79%, 73.73% 54.3%, 49.9% 54.3%); transform-origin: 61.83% 47.46%; --tx: 6.36%; --ty: 3.65%; --rot: 8deg; animation-delay: 0.03s; }
.egl > .egl-p:nth-child(15) { clip-path: polygon(38.04% 33.79%, 49.9% 54.3%, 26.07% 54.3%); transform-origin: 38% 47.46%; --tx: -6.37%; --ty: 3.65%; --rot: -13deg; animation-delay: 0.03s; }
.egl > .egl-p:nth-child(16) { clip-path: polygon(61.87% 33.79%, 49.9% 54.3%, 38.04% 33.79%); transform-origin: 49.93% 40.63%; --tx: 0%; --ty: 0%; --rot: 18deg; animation-delay: 0s; }
@keyframes egl-base { 0%, 12% { opacity: 1; } 13.5%, 87.6% { opacity: 0; } 89%, 100% { opacity: 1; } }
@keyframes egl-break {
  0%, 12% { opacity: 1; transform: none; }
  44%, 52% { opacity: .92; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(.84); }
  84% { opacity: 1; transform: none; animation-timing-function: linear; }
  100% { opacity: 1; transform: none; }
}
/* the words next to it ("جاري التحميل…") are not shown any more (his request), only read out by screen readers */
.egl-sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
/* SweetAlert dialogs: its loader box holds the animation instead of its spinning ring (loaderHtml: logoLoader(46)) */
.swal2-loader:has(> .egl) { border: 0 !important; border-radius: 0 !important; background: none !important; animation: none !important;
  width: auto !important; height: auto !important; margin: 0 auto 6px !important; }
/* a button that is saving: a small turning logo next to its text (16 px is too small for the 16 pieces) */
.btn.is-busy::after { content: ''; display: inline-block; width: 16px; height: 16px; margin-inline-start: 8px; flex: none;
  background: url('../img/logo-login.png') center / 100% 100% no-repeat; clip-path: polygon(2.34% 13.28%, 97.66% 13.28%, 49.8% 95.31%); animation: egl-mini 1.2s ease-in-out infinite; }
@keyframes egl-mini { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.7); } 100% { transform: rotate(360deg) scale(1); } }
/* egl:end */
