/* =====================================================================
 * app.css — Live Auction Platform shared stylesheet
 * REDESIGN: translated from the Figma Make "AuctionHQ" design.
 * Light, editorial theme — warm off-white canvas, white cards, dark-navy
 * primary, gold accent. System-font stacks (no CDN) approximating the Figma
 * pairing (Outfit display / Inter body) via weight + letter-spacing.
 *
 * Every class name used by the existing admin.js / screen.js / bid.js /
 * results.js / *.php is preserved here, only restyled — no behaviour or
 * markup contract changes. New Figma components added alongside.
 * ===================================================================== */

:root {
  --bg:            #f6f5f2;
  --bg-raised:     #ffffff;
  --bg-inset:      #f0ede8;
  --bg-muted:      #eeede9;
  --line:          rgba(18, 21, 30, 0.10);
  --line-bright:   rgba(18, 21, 30, 0.18);

  --ink:           #12151e;
  --ink-dim:       #6b6b78;
  --ink-faint:     #9a9aa4;

  --primary:       #1a2540;
  --primary-2:     #243055;
  --primary-ink:   #ffffff;

  --accent:        #c8841a;
  --accent-soft:   #faf3e6;
  --accent-line:   #e6d4ad;

  --live:          #1a7a45;
  --live-soft:     #e7f4ec;
  --warn:          #c8841a;
  --warn-soft:     #faf3e6;
  --danger:        #c82929;
  --danger-soft:   #fbeaea;
  --info:          #2e4a9a;
  --sold:          #8b2fc9;

  --sidebar:       #1a2540;
  --sidebar-ink:   #e8e6e0;
  --sidebar-active:#243055;
  --sidebar-line:  rgba(255,255,255,0.08);

  --font-display: "Outfit", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --shadow:    0 1px 2px rgba(18,21,30,.04), 0 4px 16px rgba(18,21,30,.06);
  --shadow-lg: 0 12px 40px rgba(18,21,30,.16);
  --gap: 16px;
}

* { box-sizing: border-box; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar a:hover { text-decoration: none; }

code, .mono { font-family: var(--font-mono); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }

.topbar {
  display: flex; align-items: center; gap: var(--gap);
  flex-wrap: wrap;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.auction-heading { margin: -8px 0 22px; }
.auction-heading h1 { font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.auction-heading p { margin: 4px 0 0; font-size: 14px; }
.resume-auction-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.modal-auction-name { font-family: var(--font-display); font-weight: 700; margin: 10px 0; overflow-wrap: anywhere; }
.brand {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.01em; color: var(--primary);
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
a.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.brand::before {
  content: "\2696"; display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 15px;
}

.code-chip {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  background: var(--bg-inset); border: 1px solid var(--line-bright);
  padding: 6px 12px; border-radius: 999px;
  letter-spacing: 0.16em; color: var(--ink);
}
.spacer { flex: 1; }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-bright); color: var(--ink-dim);
  background: var(--bg-raised);
}
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-faint);
}
.status[data-s="live"]       { color: var(--danger); border-color: #f0c9c9; background: var(--danger-soft); }
.status[data-s="live"]::before   { background: var(--danger); animation: pulse 1.4s infinite; }
.status[data-s="paused"]     { color: var(--warn);  border-color: var(--accent-line); background: var(--warn-soft); }
.status[data-s="paused"]::before { background: var(--warn); }
.status[data-s="draft"]      { color: var(--ink-dim); }
.status[data-s="ended"]      { color: var(--live);  border-color: #bfe2cd; background: var(--live-soft); }
.status[data-s="ended"]::before  { background: var(--live); }
.status[data-s="terminated"] { color: var(--live); border-color: #bfe2cd; background: var(--live-soft); }
.status[data-s="terminated"]::before { background: var(--live); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 24px; }
.panel h2 {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-dim); margin-bottom: 16px;
}

.live-card { border-color: var(--accent-line); }
.live-title { font-size: 24px; line-height: 1.12; margin-bottom: 4px; color: var(--ink); }
.live-meta { color: var(--ink-dim); font-size: 14px; margin-bottom: 18px; }

.bid-readout {
  display: flex; align-items: baseline; gap: 14px;
  padding: 18px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 8px;
}
.bid-amount { font-family: var(--font-display); font-size: 38px; font-weight: 800; color: var(--accent); }
.bid-amount.none { color: var(--ink-faint); font-weight: 700; }
.bid-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); font-weight: 600; }
.bidder-line { font-size: 15px; color: var(--ink-dim); margin: 10px 2px 0; }
.bidder-line b { color: var(--ink); }
.bidder-num { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }

.countdown {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  margin: 14px 0 4px; color: var(--ink);
}
.countdown.snipe { color: var(--danger); }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line-bright); background: var(--bg-raised);
  color: var(--ink); padding: 10px 16px; border-radius: var(--r-md);
  cursor: pointer; transition: transform .05s, background .15s, border-color .15s, box-shadow .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: var(--bg-muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-go     { background: var(--live);    border-color: var(--live);    color: #fff; }
.btn-go:hover     { background: #166a3b; }
.btn-warn   { background: var(--warn);    border-color: var(--warn);    color: #fff; }
.btn-warn:hover   { background: #b0740f; }
.btn-reset  { background: var(--bg-raised); border-color: var(--accent-line); color: #8a5a10; }
.btn-reset:hover  { background: var(--warn-soft); border-color: var(--accent); }
.btn-danger { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.btn-danger:hover { background: #ad2020; }
.btn-info   { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-info:hover   { background: #141d33; }
.btn-accent { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.btn-accent:hover { background: #b0740f; }
.btn-block  { width: 100%; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn-row .full { grid-column: 1 / -1; }

.item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-raised); margin-bottom: 10px;
}
.item[data-s="live"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
.item[data-s="sold"] { background: var(--bg); }
.item-thumb {
  width: 48px; height: 48px; border-radius: var(--r-md);
  object-fit: cover; background: var(--bg-inset); border: 1px solid var(--line);
}
.item-thumb.ph { display: grid; place-items: center; color: var(--ink-faint); font-size: 18px; }
.item-name { font-weight: 600; color: var(--ink); }
.item-sub { font-size: 13px; color: var(--ink-dim); font-family: var(--font-mono); }
.item-tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-bright); color: var(--ink-dim); background: var(--bg);
}
.item-tag[data-s="live"]    { color: var(--danger); border-color: #f0c9c9; background: var(--danger-soft); }
.item-tag[data-s="sold"]    { color: var(--live);   border-color: #bfe2cd; background: var(--live-soft); }
.item-tag[data-s="pending"] { color: var(--ink-dim); }
.item-tag[data-s="closed"]  { color: var(--ink-faint); }
.item-start { padding: 8px 14px; font-size: 13px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; text-align: center;
}
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); font-weight: 600; margin-bottom: 4px; }
.stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink); }
.stat .v.accent { color: var(--accent); }

.timer-bar { height: 4px; border-radius: 999px; background: var(--bg-muted); overflow: hidden; margin-top: 8px; }
.timer-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--live); transition: width .9s linear, background .3s; }

.feed { display: flex; flex-direction: column; }
.feed-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.feed-row:last-child { border-bottom: 0; }
.feed-row.newest { background: var(--live-soft); border-radius: var(--r-sm); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--bg-muted); color: var(--ink-dim);
}
.feed-row.newest .avatar { background: var(--live); color: #fff; }
.feed-name { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); }
.feed-amt { font-size: 14px; font-weight: 600; color: var(--ink); }
.feed-row.newest .feed-amt { color: var(--live); }

label { display: block; font-size: 13px; color: var(--ink); font-weight: 500; margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--line-bright); border-radius: var(--r-md);
  padding: 11px 12px; margin-bottom: 14px;
}
select { min-height: 47px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,132,26,.18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.reveal {
  background: var(--accent-soft); border: 1px dashed var(--accent);
  border-radius: var(--r-md); padding: 18px; margin: 14px 0;
}
.reveal .rc {
  font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: 0.2em;
  color: var(--accent); text-align: center; padding: 8px 0;
}
.warn-text { color: var(--danger); font-size: 14px; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md); font-size: 14px;
  border: 1px solid var(--line-bright); margin-top: 14px;
}
.alert.success { background: var(--live-soft); border-color: #bfe2cd; color: #166a3b; }
.alert.warn    { background: var(--warn-soft); border-color: var(--accent-line); color: #8a5a10; }
.alert.danger  { background: var(--danger-soft); border-color: #f0c9c9; color: #9e2020; }

.muted { color: var(--ink-dim); }
.center { text-align: center; }
.hidden { display: none !important; }
.empty { color: var(--ink-faint); text-align: center; padding: 28px 0; font-size: 14px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; border: 1px solid var(--primary-2);
  padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--danger); border-color: var(--danger); color: #fff; }
.links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; align-items: center; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(18,21,30,.55); display: grid; place-items: center;
  z-index: 40; padding: 20px;
}
.modal {
  background: var(--bg-raised); border: 1px solid var(--line-bright);
  border-radius: var(--r-xl); padding: 26px; max-width: 440px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal h2 { color: var(--ink); }
.modal-title { font-size: 18px; text-transform: none; color: var(--ink); }
.verification-code-input {
  font-family: var(--font-display); font-size: 26px; font-weight: 800;
  text-align: center; letter-spacing: 0; margin-bottom: 8px;
}
.verification-expiry { font-size: 13px; margin: 0 0 14px; }
.verification-actions { margin-top: 10px; }

/* ---- site footer (landing / utility pages) ---- */
.site-footer {
  text-align: center; color: var(--ink-dim); font-size: 13px;
  padding: 28px 16px 32px; margin-top: 8px;
}
.site-footer a { color: var(--accent); }

/* ---- landing hero ---- */
.hero { max-width: 760px; margin: 8px 0 28px; }
.hero h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.12; margin-bottom: 12px; }
.hero p { font-size: 18px; color: var(--ink-dim); line-height: 1.55; margin: 0 0 10px; max-width: 620px; }
.hero .hero-points { font-size: 14px; color: var(--ink-faint); font-weight: 600; }
.landing-grid {
  grid-template-columns: minmax(0, 760px) 360px;
  align-items: start;
}
.landing-page .field-row {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.landing-page #createPanel {
  max-width: 760px;
}
.landing-page .landing-grid .panel + .panel {
  margin-top: 0;
}
.landing-page .recover-panel {
  align-self: start;
}
.landing-page #recoverBtn {
  margin-top: 36px;
}
.btn-demo {
  margin-top: 10px;
  background: var(--bg-raised);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-demo:hover {
  background: var(--bg-muted);
  border-color: var(--primary-2);
}

/* ---- readiness checklist + bid history ---- */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 9px 11px 9px 34px; position: relative; color: var(--ink-dim);
  background: var(--bg-raised); font-size: 14px;
}
.checklist li::before {
  content: ""; position: absolute; left: 11px; top: 11px;
  width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line-bright);
  background: var(--bg);
}
.checklist li.done { color: var(--live); background: var(--live-soft); border-color: #bfe2cd; }
.checklist li.done::before { content: "✓"; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: var(--live); border-color: var(--live); }
.history-list { display: grid; gap: 8px; }
.history-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-amt { font-family: var(--font-display); font-weight: 800; color: var(--accent); white-space: nowrap; }
.content-page { max-width: 820px; }
.content-page h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.content-page h2 { margin-top: 24px; font-size: 22px; color: var(--ink); text-transform: none; letter-spacing: -0.01em; }
.content-page p, .content-page li { color: var(--ink-dim); }
.content-page ul { padding-left: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.card-grid .panel { margin-top: 0; }
@media (max-width: 800px) { .card-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .landing-page .landing-grid {
    grid-template-columns: 1fr;
  }
  .landing-page #recoverBtn {
    margin-top: 0;
  }
  .admin-page .grid { gap: 24px; }
  .admin-page .grid > div { display: contents; }
  .admin-page .grid .panel { margin-top: 0; }
  .admin-current-panel { order: 1; }
  .admin-summary-panel { order: 2; }
  .admin-items-panel { order: 3; }
  .admin-add-panel { order: 4; }
  .admin-history-panel { order: 5; }
  .admin-checklist-panel { order: 6; }
}

@media (max-width: 560px) {
  .landing-page .field-row { grid-template-columns: 1fr; }
  .wrap { padding: 18px 24px; }
  .topbar {
    gap: 8px 10px;
    padding: 8px 0 12px;
    margin-bottom: 18px;
  }
  .topbar .spacer { display: none; }
  .brand { font-size: 18px; gap: 7px; }
  .brand::before {
    width: 28px; height: 28px; border-radius: 8px;
    font-size: 14px;
  }
  .code-chip {
    font-size: 13px;
    padding: 5px 10px;
    letter-spacing: 0.12em;
  }
  .status {
    font-size: 11px;
    padding: 5px 10px;
    gap: 6px;
  }
  .status::before { width: 7px; height: 7px; }
  .topbar .muted { font-size: 14px; margin-left: auto; }
  .auction-heading { margin-top: -4px; }
  .auction-heading h1 { font-size: 23px; }
  .links {
    width: 100%;
    gap: 12px;
    font-size: 13px;
  }
  .panel { padding: 20px; }
  .bid-readout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    padding: 14px;
  }
  .bid-readout .spacer { display: none; }
  .bid-readout .center { text-align: left; }
  .bid-amount { font-size: 34px; line-height: 1.05; }
  .bid-amount.none {
    font-size: 30px;
    white-space: nowrap;
  }
  .live-title { font-size: 23px; }
  .countdown { font-size: 21px; }
  .btn-row { gap: 8px; }
  .item {
    grid-template-columns: 48px 1fr;
    gap: 12px;
  }
  .item > .item-actions,
  .item > .item-tag,
  .item > .item-start {
    grid-column: 2;
    justify-self: start;
  }
  .item-actions { justify-content: flex-start; }
}
