/* ===========================================================
   Tizaro — Anti-counterfeit verification
   Design system: medical blue #0088CC + teal #2BAAB1,
   genuine=green, danger=red, warning=amber. Clean pharma style.
   =========================================================== */

:root {
  /* Brand palette (overridden by config-driven :root in index.html) */
  --c-primary: #0088CC;
  --c-primary-dark: #006699;
  --c-secondary: #2BAAB1;
  --c-ink: #212529;
  /* Semantic result colors */
  --c-genuine: #0d9488;
  --c-genuine-bg: #ecfdf5;
  --c-danger: #e36159;
  --c-danger-bg: #fdecea;
  --c-warning: #f0ad4e;
  --c-warning-bg: #fff8ec;
  /* Neutrals */
  --c-muted: #6c757d;
  --c-line: #e6e9ed;
  --c-bg: #f5f8fa;
  --c-white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 34px rgba(33, 37, 41, 0.10);
  --shadow-sm: 0 4px 14px rgba(33, 37, 41, 0.06);
  --maxw: 1120px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
          "Microsoft YaHei", "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(33,37,41,.03);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; text-decoration: none; gap: 8px; }
.brand__mark { font-weight: 800; font-size: 21px; color: var(--c-primary); letter-spacing: .3px; }
.brand__sub { font-weight: 600; font-size: 14px; color: var(--c-ink); opacity: .65; }
.brand__logo { height: 34px; width: auto; }
.brand--footer .brand__mark { color: var(--c-primary); }
.brand__logo--footer { height: 30px; }

.lang-switch {
  display: inline-flex; border: 1px solid var(--c-line); border-radius: 999px;
  overflow: hidden; background: var(--c-white);
}
.lang-switch button {
  border: none; background: transparent; padding: 6px 13px; font-size: 13px;
  font-weight: 700; cursor: pointer; color: var(--c-muted);
}
.lang-switch button.is-active { background: var(--c-primary); color: #fff; }

.topnav { display: flex; gap: 24px; }
.topnav a {
  text-decoration: none; color: var(--c-muted); font-size: 14px; font-weight: 600;
  position: relative; padding: 4px 0;
}
.topnav a:hover { color: var(--c-primary); }
.topnav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--c-primary); transition: width .2s;
}
.topnav a:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 55%, var(--c-secondary) 120%);
  color: #fff; padding: 70px 0 130px; text-align: center; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 40%),
              radial-gradient(circle at 80% 0%, rgba(255,255,255,.10), transparent 35%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: 3px; font-size: 12px; opacity: .9; font-weight: 700;
}
.hero__title { font-size: 46px; margin: 10px 0 6px; font-weight: 800; letter-spacing: -.5px; }
.hero__tagline { font-size: 19px; font-weight: 600; color: #d6f3f6; margin: 0 0 14px; }
.hero__lead { max-width: 580px; margin: 0 auto 8px; font-size: 16px; opacity: .95; }

/* ---------- Verify card (floats over hero) ---------- */
.verify-wrap { max-width: 760px; margin: -96px auto 0; position: relative; z-index: 5; }
.verify-card {
  background: var(--c-white); border-radius: 20px; box-shadow: var(--shadow);
  padding: 34px; border: 1px solid rgba(255,255,255,.6);
}
.verify-card__title { font-size: 22px; margin: 0 0 6px; color: var(--c-ink); font-weight: 800; text-align: center; }
.verify-card__hint { color: var(--c-muted); margin: 0 0 22px; font-size: 14px; text-align: center; }

.verify-form { display: flex; gap: 12px; flex-wrap: wrap; }
.code-input {
  flex: 1 1 280px; min-width: 0; padding: 17px 20px; font-size: 22px; letter-spacing: 8px;
  text-align: center; border: 2px solid var(--c-line); border-radius: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s; font-family: "Courier New", monospace; font-weight: 700;
}
.code-input::placeholder { letter-spacing: 2px; color: #b6bfc7; font-weight: 400; }
.code-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(0,136,204,.15); }
.btn {
  border: none; border-radius: 14px; padding: 16px 30px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn--primary { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); color: #fff; box-shadow: 0 8px 20px rgba(0,136,204,.28); }
.btn--primary:hover { background: linear-gradient(135deg, var(--c-primary-dark), #005580); }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:disabled { opacity: .6; cursor: not-allowed; }

.privacy-note { margin: 16px 0 0; font-size: 13px; color: var(--c-muted); text-align: center; }

/* ---------- Result ---------- */
.result {
  margin-top: 22px; border-radius: 14px; padding: 22px; border: 1px solid transparent;
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result--genuine { background: var(--c-genuine-bg); border-color: #bbf7d0; }
.result--counterfeit { background: var(--c-danger-bg); border-color: #f8c9c4; }
.result--invalid { background: var(--c-warning-bg); border-color: #f6e0b3; }
.result__head { display: flex; align-items: center; gap: 14px; }
.result__icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; font-weight: 800; color: #fff; flex: none;
}
.result__icon.icon-genuine { background: var(--c-genuine); }
.result__icon.icon-genuine::before { content: "\2713"; }
.result__icon.icon-counterfeit { background: var(--c-danger); }
.result__icon.icon-counterfeit::before { content: "\2715"; }
.result__icon.icon-invalid { background: var(--c-warning); }
.result__icon.icon-invalid::before { content: "!"; }
.result__title { margin: 0; font-size: 21px; }
.result--genuine .result__title { color: var(--c-genuine); }
.result--counterfeit .result__title { color: var(--c-danger); }
.result--invalid .result__title { color: #c8841a; }
.result__msg { margin: 10px 0 0; color: #374151; font-size: 14px; }
.result__meta {
  margin-top: 16px; border-top: 1px dashed rgba(0,0,0,.12); padding-top: 14px; display: grid; gap: 8px;
}
.meta-row { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.is-hidden { display: none !important; }
.meta-row span { color: var(--c-muted); }
.meta-row b { color: var(--c-ink); text-align: right; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--c-white); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.section__eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; color: var(--c-primary); font-weight: 700; margin: 0 0 6px; }
.section__title { font-size: 30px; margin: 0 0 10px; color: var(--c-ink); font-weight: 800; }
.section__lead { max-width: 660px; color: var(--c-muted); margin: 0 0 32px; }
.section__head { text-align: center; }
.section__head .section__lead { margin-left: auto; margin-right: auto; }

/* ---------- Trust badges ---------- */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.trust__item {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; box-shadow: var(--shadow-sm);
}
.trust__icon { font-size: 30px; color: var(--c-primary); margin-bottom: 8px; }
.trust__num { font-size: 30px; font-weight: 800; color: var(--c-primary-dark); }
.trust__label { font-size: 13px; color: var(--c-muted); margin-top: 2px; }

.certs { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.cert-pill {
  background: var(--c-ink); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 14px;
  border-radius: 8px; letter-spacing: .5px;
}

/* ---------- How to verify ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.steps li {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 26px 22px 22px; position: relative; counter-increment: step; box-shadow: var(--shadow-sm);
}
.steps li::before {
  content: counter(step); position: absolute; top: -15px; left: 22px; width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary)); color: #fff; font-weight: 800;
  border-radius: 50%; display: grid; place-items: center; font-size: 14px; box-shadow: var(--shadow-sm);
}
.steps li h3 { margin: 8px 0 6px; font-size: 17px; color: var(--c-ink); }
.steps li p { margin: 0; color: var(--c-muted); font-size: 14px; }

/* ---------- Products ---------- */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card__dose { display: inline-block; background: var(--c-genuine-bg); color: var(--c-genuine); font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }
.product-card__name { font-size: 17px; font-weight: 800; color: var(--c-ink); margin: 0 0 4px; }
.product-card__type { font-size: 13px; color: var(--c-muted); margin: 0 0 10px; }
.product-card__foot { font-size: 12px; color: var(--c-muted); border-top: 1px dashed var(--c-line); padding-top: 10px; }

/* ---------- Warning ---------- */
.warning { background: #16181b; color: #f8fafc; }
.warning__inner { max-width: 760px; }
.warning__tag {
  display: inline-block; background: var(--c-danger); color: #fff; font-weight: 800; letter-spacing: 2px;
  padding: 5px 14px; border-radius: 6px; font-size: 12px;
}
.warning h2 { font-size: 24px; margin: 14px 0 12px; }
.warning p { color: #cbd5e1; }
.warning code { background: rgba(255,255,255,.1); padding: 2px 6px; border-radius: 4px; }
.warning__closing { font-weight: 700; color: #f8b4b0; }

/* ---------- Footer ---------- */
.footer { background: var(--c-white); border-top: 1px solid var(--c-line); padding: 40px 0 28px; }
.footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer__about p { color: var(--c-muted); font-size: 14px; }
.footer__col h4 { font-size: 14px; margin: 0 0 12px; color: var(--c-ink); }
.footer__col a { display: block; color: var(--c-muted); font-size: 14px; margin-bottom: 8px; }
.footer__col a:hover { color: var(--c-primary); }
.footer__bottom { border-top: 1px solid var(--c-line); margin-top: 28px; padding-top: 18px; color: var(--c-muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ===========================================================
   Admin
   =========================================================== */
.admin-body { background: var(--c-bg); }
.admin-top { background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary)); color: #fff; }
.admin-top__inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.admin-top strong { font-size: 17px; letter-spacing: .3px; }
.btn-ghost {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4); color: #fff;
  padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-ghost:hover { background: rgba(255,255,255,.24); }
.admin-main { padding: 28px 0 60px; }
.admin-logo { height: 30px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--c-line); border-radius: 14px; padding: 20px; text-align: center; box-shadow: var(--shadow-sm); border-top: 3px solid var(--c-primary); }
.stat span { font-size: 32px; font-weight: 800; color: var(--c-primary); }
.stat small { display: block; color: var(--c-muted); margin-top: 4px; font-size: 13px; }
.stat--warn { border-top-color: var(--c-danger); }
.stat--warn span { color: var(--c-danger); }

.panel { background: #fff; border: 1px solid var(--c-line); border-radius: 14px; padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.panel h2 { margin: 0 0 16px; font-size: 18px; color: var(--c-ink); display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--c-primary); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type="text"], .toolbar input:not([type]), #search { padding: 9px 12px; border: 2px solid var(--c-line); border-radius: 8px; min-width: 220px; font-size: 14px; }
.toolbar input:focus { border-color: var(--c-primary); outline: none; }
.btn { background: var(--c-primary); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--c-primary-dark); }
.filebtn { background: var(--c-ink); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; }
.filebtn:hover { background: #000; }
.msg { font-size: 13px; }
.add-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.add-form input { padding: 9px 12px; border: 2px solid var(--c-line); border-radius: 8px; font-size: 14px; flex: 1 1 150px; min-width: 120px; }
.add-form input:focus { border-color: var(--c-primary); outline: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--c-line); }
th { color: var(--c-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:hover { background: #f8fafc; }
code { background: #eef4f9; padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.btn-del { background: var(--c-danger-bg); color: var(--c-danger); border: 1px solid #f8c9c4; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.btn-del:hover { background: var(--c-danger); color: #fff; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #374151; margin-bottom: 12px; }
.settings-form { display: grid; gap: 16px; }
.settings-form fieldset { border: 1px solid var(--c-line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.settings-form legend { font-weight: 700; color: var(--c-ink); padding: 0 6px; }
.settings-form label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #374151; }
.settings-form input[type="text"], .settings-form input:not([type="color"]):not([type="checkbox"]) { flex: 1; padding: 8px 12px; border: 2px solid var(--c-line); border-radius: 8px; font-size: 14px; }
.settings-form input[type="color"] { width: 44px; height: 32px; border: none; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-secondary) 120%); font-family: var(--font); }
.login-card { background: #fff; border-radius: 18px; padding: 38px 34px; width: 360px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.login-card h1 { font-size: 22px; margin: 0 0 4px; color: var(--c-primary-dark); }
.login-card p { color: var(--c-muted); font-size: 13px; margin: 0 0 22px; }
.login-card label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; font-weight: 600; }
.login-card input { width: 100%; padding: 12px 14px; border: 2px solid var(--c-line); border-radius: 10px; font-size: 15px; box-sizing: border-box; }
.login-card input:focus { border-color: var(--c-primary); outline: none; box-shadow: 0 0 0 3px rgba(0,136,204,.15); }
.login-card button { width: 100%; margin-top: 18px; background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); color: #fff; border: none; padding: 13px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 15px; }
.login-card button:hover { filter: brightness(.96); }
.login-card .err { color: var(--c-danger); font-size: 13px; margin-top: 12px; min-height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .trust { grid-template-columns: repeat(2, 1fr); }
  .products { grid-template-columns: repeat(2, 1fr); }
  .footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .topnav { display: none; }
  .hero__title { font-size: 36px; }
  .steps { grid-template-columns: 1fr; }
  .verify-wrap { margin-top: -70px; }
}
@media (max-width: 560px) {
  .trust, .products, .stats, .footer__cols { grid-template-columns: 1fr; }
  .verify-form { flex-direction: column; }
  .btn--primary { width: 100%; }
  .hero { padding: 48px 0 110px; }
}
