/* =========================================================================
   Apex Access — shared theme (spec §2, LOCKED: Maroon & Gold)
   Loaded by every surface. No build step: edit, scp, hard refresh.
   ========================================================================= */

:root {
  --deep-1: #6e1f2e;
  --deep-2: #4a1420;
  --deep-3: #320d16;
  --gold-1: #f2d98a;
  --gold-2: #cf9f3f;
  --gold-ink: #341c00;

  --ink: #23171a;
  --ink-soft: #6b5c60;
  --line: #e7dcd6;
  --paper: #fbf7f4;
  --surface: #ffffff;

  --ok: #1f7a4d;
  --ok-soft: #e3f5ea;
  --warn: #9a6a08;
  --warn-soft: #fdf1d6;
  --bad: #a32020;
  --bad-soft: #fbe7e7;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(50, 13, 22, .10);
  --shadow-lg: 0 22px 50px rgba(50, 13, 22, .22);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --telugu: "Noto Sans Telugu", var(--sans);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body[data-lang="te"] { font-family: var(--telugu); }

a { color: var(--deep-1); }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .2px; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
.section-title { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 0 0 2px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ------------------------------------------------------------------ header */

.apex-header {
  background: linear-gradient(135deg, var(--deep-1) 0%, var(--deep-2) 55%, var(--deep-3) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 40;
}
.apex-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.logo-badge {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2));
  color: var(--gold-ink);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}
.brand { font-family: var(--serif); font-size: 25px; font-weight: 700; line-height: 1.1; }
.brand .accent { color: var(--gold-1); }
.brand-sub { font-size: 11.5px; letter-spacing: .10em; text-transform: uppercase; color: rgba(255,255,255,.66); }

.pill-group {
  display: inline-flex;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(242, 217, 138, .32);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.pill-group button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: rgba(255,255,255,.85);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.pill-group button[aria-pressed="true"] {
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2));
  color: var(--gold-ink);
}
.pill-group button.te { font-family: var(--telugu); }

/* ------------------------------------------------------------------- shell */

.shell { max-width: 1080px; margin: 0 auto; padding: 22px 18px 72px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ------------------------------------------------------------------ inputs */

label.field { display: block; }
label.field > span {
  display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-soft); margin-bottom: 5px;
}
input, select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--deep-1);
  box-shadow: 0 0 0 3px rgba(110, 31, 46, .12);
}
input.otp { letter-spacing: .5em; font-size: 20px; text-align: center; font-family: ui-monospace, monospace; }
textarea { min-height: 76px; resize: vertical; }

.btn {
  appearance: none; cursor: pointer;
  font: inherit; font-weight: 650;
  border-radius: 11px;
  padding: 11px 18px;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2));
  color: var(--gold-ink);
  box-shadow: 0 6px 18px rgba(207, 159, 63, .32);
}
.btn-deep {
  background: linear-gradient(140deg, var(--deep-1), var(--deep-3));
  color: #fff;
  box-shadow: 0 6px 18px rgba(50, 13, 22, .3);
}
.btn-ghost { background: #fff; border-color: var(--line); color: var(--deep-2); }
.btn-ghost:hover { border-color: var(--deep-1); }
.btn-link { background: none; border: 0; color: var(--deep-1); text-decoration: underline; padding: 4px 2px; cursor: pointer; font: inherit; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- pills */

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending  { background: var(--warn-soft); color: var(--warn); border-color: #efd9a4; }
.status-active   { background: var(--ok-soft);   color: var(--ok);   border-color: #bfe6cf; }
.status-bad      { background: var(--bad-soft);  color: var(--bad);  border-color: #f0c9c9; }
.status-neutral  { background: #f1ecea; color: var(--ink-soft); border-color: var(--line); }

.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: #f6efe6; color: var(--deep-2); border: 1px solid #ecdcc4;
}

/* ------------------------------------------------------- the Access Card §2 */

.access-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--deep-1) 0%, var(--deep-2) 52%, var(--deep-3) 100%);
  box-shadow: var(--shadow-lg);
  min-height: 216px;
  isolation: isolate;
}
/* 1px gold-gradient border */
.access-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--gold-1), rgba(207, 159, 63, .35) 45%, var(--gold-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}
/* diagonal foil sheen, slow light sweep */
.access-card::after {
  content: "";
  position: absolute;
  top: -60%; bottom: -60%; left: -40%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .16) 45%, rgba(242, 217, 138, .30) 50%, rgba(255,255,255,.10) 56%, transparent);
  transform: rotate(16deg);
  animation: foil-sweep 7s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes foil-sweep {
  0%, 62% { left: -45%; opacity: 0; }
  68%     { opacity: 1; }
  100%    { left: 115%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .access-card::after { animation: none; opacity: .35; left: 18%; }
}
/* oversized "A" watermark, bottom-right */
.access-card .watermark {
  position: absolute;
  right: -14px; bottom: -58px;
  font-family: var(--serif); font-weight: 700; font-size: 210px; line-height: .78;
  color: rgba(242, 217, 138, .07);
  pointer-events: none;
  z-index: 0;
}
.access-card > * { position: relative; z-index: 2; }

.card-brandline { display: flex; align-items: center; gap: 10px; }
.card-brandline .logo-badge { width: 32px; height: 32px; flex-basis: 32px; font-size: 19px; border-radius: 10px; }
.card-brandname { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.1; }
.card-brandname .accent { color: var(--gold-1); }
.card-holder { margin-top: 18px; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.card-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.card-id { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 16px; letter-spacing: .08em; color: var(--gold-1); margin-top: 2px; }
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 14px; }
.card-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.card-qr {
  background: #fff;
  border-radius: 10px;
  padding: 7px;
  width: 82px; height: 82px;
  flex: 0 0 82px;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.card-qr svg, .card-qr img { width: 100%; height: 100%; display: block; }
.card-discount { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--gold-1); line-height: 1; }

/* ------------------------------------------------------------------ lists */

.list-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.list-item + .list-item { margin-top: 10px; }
.list-item:hover { border-color: #d9c3a8; box-shadow: 0 6px 18px rgba(50,13,22,.07); }

.modality-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  font: inherit; color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.modality-card:hover { transform: translateY(-2px); border-color: var(--gold-2); box-shadow: 0 14px 30px rgba(50,13,22,.12); }
.modality-card[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.modality-card .mc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mc-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px;
  background: linear-gradient(150deg, var(--deep-1), var(--deep-3));
  color: var(--gold-1);
  display: grid; place-items: center; font-size: 15px; font-weight: 700; font-family: var(--serif);
}

/* slot grid */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot {
  appearance: none; font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 9px 4px; cursor: pointer;
  transition: all .14s ease;
}
.slot:hover:not([disabled]) { border-color: var(--gold-2); background: #fffaf0; }
.slot[aria-pressed="true"] {
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2));
  border-color: var(--gold-2); color: var(--gold-ink);
}
.slot[disabled] { opacity: .38; cursor: not-allowed; text-decoration: line-through; }
.slot-hourhead { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--ink-soft); letter-spacing: .06em; margin-top: 6px; }

/* date strip */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.date-chip {
  appearance: none; font: inherit; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 12px; min-width: 74px; text-align: center; flex: 0 0 auto;
}
.date-chip[aria-pressed="true"] { background: linear-gradient(140deg, var(--deep-1), var(--deep-3)); color: #fff; border-color: var(--deep-2); }
.date-chip .dc-dow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.date-chip .dc-day { font-family: var(--serif); font-size: 19px; font-weight: 700; }

/* summary / bill */
.bill-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.bill-row + .bill-row { border-top: 1px dashed var(--line); }
.bill-total { font-family: var(--serif); font-size: 21px; font-weight: 700; }
.bill-discount { color: var(--ok); font-weight: 650; }

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
table.data tr:hover td { background: #fdfaf7; }
.table-wrap { overflow-x: auto; }

/* notices */
.notice { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; border: 1px solid; }
.notice-info { background: #f6efe6; border-color: #ecdcc4; color: var(--deep-2); }
.notice-warn { background: var(--warn-soft); border-color: #efd9a4; color: var(--warn); }
.notice-ok   { background: var(--ok-soft);   border-color: #bfe6cf; color: var(--ok); }
.notice-bad  { background: var(--bad-soft);  border-color: #f0c9c9; color: var(--bad); }

/* toast */
.toast-host { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast {
  background: var(--deep-3); color: #fff; border: 1px solid rgba(242,217,138,.35);
  border-radius: 12px; padding: 12px 15px; font-size: 13.5px; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
}
.toast.bad { background: #6d1414; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* steps */
.steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; font-size: 11.5px;
}
.step[data-state="active"] { color: var(--deep-2); }
.step[data-state="active"] .dot { background: linear-gradient(150deg, var(--gold-1), var(--gold-2)); border-color: var(--gold-2); color: var(--gold-ink); }
.step[data-state="done"] .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-sep { width: 16px; height: 1px; background: var(--line); }

.footer { text-align: center; color: var(--ink-soft); font-size: 12.5px; padding: 26px 18px 10px; }

.skeleton { background: linear-gradient(90deg, #f0e9e4 25%, #f8f3ef 50%, #f0e9e4 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 560px) {
  h1 { font-size: 25px; }
  .shell { padding: 16px 14px 60px; }
  .panel { padding: 15px; }
  .apex-header-inner { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 21px; }
  .access-card { padding: 17px 18px 16px; }
  .card-qr { width: 70px; height: 70px; flex-basis: 70px; }
}
