/* Digital student card demo - design system (bilingual, RTL-aware) */

:root {
  --brand: #5b21b6;
  --brand-2: #8b5cf6;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ef;
  --bg: #f3f5fa;
  --card: #ffffff;
  --ok: #067647;
  --ok-bg: #e7f6ef;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #92400e;
  --warn-bg: #fef3e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Hebrew", Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------- structure */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .06em; border-radius: 9px; padding: 8px 10px; }
.brand-logo { width: 46px; height: 46px; display: block; }
.brand-name { font-weight: 700; line-height: 1.15; display: flex; flex-direction: column; }
.brand-name small { color: var(--muted); font-weight: 500; }
.topnav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 14px; }
.topnav a { color: var(--ink); }
.langswitch { color: var(--brand); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 13px; }
.page { max-width: 1080px; margin: 0 auto; padding: 26px 20px 40px; }
.foot { max-width: 1080px; margin: 0 auto; padding: 18px 20px 30px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.narrow { max-width: 560px; margin: 4vh auto 0; }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }

/* ------------------------------------------------------------------ forms */
.frm { display: flex; flex-direction: column; gap: 12px; }
.frm label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; }
.frm input[type=email], .frm input[type=password], .frm input[type=text] {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff;
}
.frm input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.lbl { font-weight: 600; font-size: 13.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 700; transition: filter .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: #c6cbd6; }
.btn.sm { padding: 8px 13px; font-size: 13.5px; }
.btn.wallet { color: #fff; }
.btn.wallet.apple { background: #000; }
.btn.wallet.google { background: #1f2937; }
.btn.wallet:hover { filter: brightness(1.15); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ------------------------------------------------------------------ login */
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; max-width: 900px; margin: 5vh auto 0; }
.login-hero { background: linear-gradient(140deg, #2e1065 0%, #5b21b6 70%, #8b5cf6 100%); color: #fff;
  border-radius: 20px; padding: 38px 34px; box-shadow: var(--shadow); }
.hero-mark { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; padding: 8px 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 22px; }
.hero-logo { display: inline-flex; background: #fff; border-radius: 20px; padding: 10px; margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.hero-logo img { width: 84px; height: 84px; display: block; }
.login-hero h1 { font-size: 30px; line-height: 1.15; }
.hero-he { font-size: 21px; margin: 6px 0 0; opacity: .95; }
.hero-tag { opacity: .8; margin-top: 12px; }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 9px; }
.hero-points li { padding-inline-start: 22px; position: relative; opacity: .92; }
.hero-points li::before { content: ""; position: absolute; inset-inline-start: 0; top: 7px; width: 8px; height: 8px;
  border-radius: 99px; background: #7fd7a4; }
.login-box { background: var(--card); border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow); }
.demo-box { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-box p { margin: 0 0 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.demo-box small { display: block; color: var(--muted); margin-top: 8px; font-family: ui-monospace, monospace; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; margin: 0 6px 6px 0;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--brand-2); color: var(--brand); }

/* ------------------------------------------------------------------- card */
.grid-card { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel.meta dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.panel.meta dt { color: var(--muted); }
.panel.meta dd { margin: 0; font-weight: 600; }

.card-scene { perspective: 1400px; max-width: 560px; }
.card3d { position: relative; width: 100%; aspect-ratio: 1.586; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4,.1,.2,1); }
.card3d.flipped { transform: rotateY(180deg); }
.cardface { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 22px; overflow: hidden;
  color: #fff; box-shadow: 0 12px 34px rgba(11, 30, 75, .35); display: flex; flex-direction: column; padding: 22px 24px; }
.cardface.back { transform: rotateY(180deg); align-items: center; justify-content: center; gap: 10px; }

.theme-colman   { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.theme-midnight { background: linear-gradient(135deg, #0b1e4b, #123a9e); }
.theme-emerald  { background: linear-gradient(135deg, #065f46, #0ea371); }
.theme-slate    { background: linear-gradient(135deg, #1f2937, #4b5563); }

/* Decorative overlay patterns (white, translucent - work on every theme) */
.c-pattern { position: absolute; inset: 0; pointer-events: none; }
.pat-none { background: none; }
.pat-dots { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='4' cy='4' r='2.4' fill='rgba(255,255,255,.16)'/%3E%3C/svg%3E"); }
.pat-waves { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='22'%3E%3Cpath d='M0 11 Q 11 0, 22.5 11 T 45 11 T 67.5 11 T 90 11' fill='none' stroke='rgba(255,255,255,.15)' stroke-width='2'/%3E%3C/svg%3E"); }
.pat-confetti { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Crect x='10' y='12' width='7' height='7' rx='1.5' fill='rgba(255,255,255,.17)' transform='rotate(18 13 15)'/%3E%3Ccircle cx='52' cy='22' r='3.6' fill='rgba(255,255,255,.14)'/%3E%3Cpath d='M72 8 l4 7 h-8 z' fill='rgba(255,255,255,.15)'/%3E%3Crect x='64' y='52' width='7' height='7' rx='1.5' fill='rgba(255,255,255,.15)' transform='rotate(-22 67 55)'/%3E%3Ccircle cx='22' cy='62' r='3.2' fill='rgba(255,255,255,.16)'/%3E%3Cpath d='M42 70 l4 7 h-8 z' fill='rgba(255,255,255,.13)' transform='rotate(30 42 73)'/%3E%3Cpath d='M84 76 h7 M87.5 72.5 v7' stroke='rgba(255,255,255,.16)' stroke-width='2'/%3E%3Cpath d='M6 38 h7 M9.5 34.5 v7' stroke='rgba(255,255,255,.14)' stroke-width='2'/%3E%3C/svg%3E"); }
.pat-geo { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 6 L50 44 H6 Z' fill='none' stroke='rgba(255,255,255,.13)' stroke-width='1.6'/%3E%3Ccircle cx='28' cy='31' r='7' fill='none' stroke='rgba(255,255,255,.11)' stroke-width='1.4'/%3E%3C/svg%3E"); }
.pat-grid { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 24 L24 0' stroke='rgba(255,255,255,.11)' stroke-width='1.4'/%3E%3C/svg%3E"); }

.pat-mini { background-color: #4c1d95; }
.themes.pats { grid-template-columns: 1fr 1fr 1fr; }
.themes.pats .swatch { padding: 7px 8px; font-size: 12.5px; gap: 7px; }
.themes.pats i { width: 24px; height: 18px; border-radius: 5px; flex: none; }

.c-deco { position: absolute; inset-inline-end: -70px; top: -90px; width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none; }
.c-deco::after { content: ""; position: absolute; inset: 40px; border-radius: 50%; background: rgba(255,255,255,.07); }
.c-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.c-ident { display: flex; align-items: center; gap: 11px; }
.c-logo { display: flex; background: #fff; border-radius: 11px; padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.c-logo img { width: 40px; height: 40px; display: block; }
.c-school { line-height: 1.25; }
.c-school strong { font-size: 14.5px; letter-spacing: .05em; display: block; }
.c-school span { font-size: 13px; opacity: .85; }
.c-year { text-align: right; font-size: 12.5px; opacity: .9; background: rgba(255,255,255,.13); border-radius: 8px; padding: 5px 9px; }
.c-year b { display: block; }
.c-mid { display: flex; align-items: center; gap: 16px; flex: 1; margin-top: 8px; }
.c-photo { width: 74px; height: 74px; border-radius: 14px; object-fit: cover; border: 2px solid rgba(255,255,255,.55); }
.c-name { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.c-name-he { font-size: 16px; opacity: .92; }
.c-no { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13.5px; letter-spacing: .14em; opacity: .85; margin-top: 5px; }
.c-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.c-tag span { font-size: 10.5px; letter-spacing: .1em; opacity: .75; }
.c-prog { font-size: 13px; font-weight: 600; margin-top: 2px; }
.c-valid { text-align: right; }
.c-valid span { display: block; font-size: 10px; letter-spacing: .08em; opacity: .75; }
.c-valid b { font-size: 14px; }

.qr-panel { background: #fff; border-radius: 16px; padding: 14px; position: relative; }
.qr-box svg { display: block; width: 148px; height: 148px; }
.qr-ring { position: absolute; inset-inline-end: -6px; top: -6px; width: 22px; height: 22px; border-radius: 99px;
  background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.qr-ring i { width: 10px; height: 10px; border-radius: 99px; background: var(--ok); display: block; }
.qr-ring i.stale { background: var(--warn); }
.qr-meta { text-align: center; font-size: 12.5px; opacity: .92; display: flex; flex-direction: column; gap: 2px; max-width: 280px; }
.qr-meta b { font-family: ui-monospace, monospace; letter-spacing: .12em; }

.card-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swatch { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.swatch input { display: none; }
.swatch i { width: 26px; height: 18px; border-radius: 5px; }
.swatch:has(input:checked) { border-color: var(--brand); outline: 1px solid var(--brand); }

/* ------------------------------------------------------------------ admin */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { font-size: 26px; display: block; }
.stat span { color: var(--muted); font-size: 13px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td span.muted { display: block; font-size: 12.5px; }
.mini { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; display: block; }
.badge { display: inline-block; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.badge.on { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--bad-bg); color: var(--bad); }

/* ----------------------------------------------------------- verification */
.verify { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; text-align: center; }
.v-banner { font-size: 26px; font-weight: 800; letter-spacing: .02em; border-radius: 14px; padding: 16px; }
.v-ok .v-banner { background: var(--ok-bg); color: var(--ok); }
.v-warn .v-banner { background: var(--warn-bg); color: var(--warn); }
.v-bad .v-banner { background: var(--bad-bg); color: var(--bad); }
.v-text { font-size: 15px; margin: 14px 0 4px; }
.v-card { display: flex; align-items: center; gap: 16px; text-align: start; background: var(--bg);
  border-radius: 14px; padding: 14px 16px; margin: 16px 0 8px; }
.v-card img { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; }
.v-card > div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.v-card b { font-size: 16px; }
.v-card .he { font-size: 14px; }
.verify small { display: block; margin-top: 10px; }

.setup { text-align: center; padding: 30px; }
.setup h1 { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; margin-bottom: 14px; }
.setup p { text-align: start; color: var(--ink); margin: 0 0 20px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; max-width: 480px; }
  .grid-card { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .page { padding: 18px 14px 30px; }
  .cardface { padding: 16px 18px; }
  .c-name { font-size: 18px; }
  .stats { grid-template-columns: 1fr; }
  .topnav { gap: 10px; font-size: 13px; }
}
