/* =========================================================
   TakeAuktion — visual identity
   Palette: charcoal-navy ground, brass/gold accent, auction red
   Display face: Fraunces (serif, auction-house gravitas)
   Body face: Inter
   Signature: the gavel mark + wax-seal LOT badges
   ========================================================= */

:root {
  --bg: #12151b;
  --surface: #1b2029;
  --surface-2: #232a36;
  --border: #2e3542;
  --text: #edeae2;
  --text-muted: #9aa1ae;
  --gold: #c9a24b;
  --gold-bright: #e4c878;
  --red: #8b2a2a;
  --red-bright: #b23a3a;
  --green: #4a8b6a;

  --radius: 6px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

a {
  color: var(--gold-bright);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

p { margin: 0 0 1em; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(18, 21, 27, 0.92);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.brand .gavel-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  transform-origin: 70% 30%;
  transition: transform 0.35s ease;
}
.brand:hover .gavel-mark {
  transform: rotate(-18deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.95rem;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--gold-bright); }
.site-nav .user-tag {
  color: var(--text-muted);
  font-size: 0.85rem;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.btn-gold {
  background: var(--gold);
  color: #1a1508;
}
.btn-gold:hover { background: var(--gold-bright); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-bright); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  background: transparent;
  border-color: var(--red-bright);
  color: var(--red-bright);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(201, 162, 75, 0.10), transparent 55%),
    var(--bg);
}

.hero .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
  display: block;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  max-width: 15ch;
  color: var(--text);
}

.hero p.lede {
  color: var(--text-muted);
  max-width: 52ch;
  font-size: 1.08rem;
  margin-top: 14px;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Section headings ---------- */

.section {
  padding: 52px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 1.7rem;
}
.section-head .hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Item grid & cards ---------- */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.item-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.item-card .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2) center/cover no-repeat;
  border-bottom: 1px solid var(--border);
}
.item-card .thumb .no-image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.lot-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--red);
  color: #f4e9e9;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 5px 10px 5px 11px;
  border-radius: 100px;
  box-shadow: var(--shadow);
}

.ended-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(18, 21, 27, 0.85);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 100px;
}

.item-card .body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.item-card h3 {
  font-size: 1.12rem;
  margin: 0;
}
.item-card h3 a { color: var(--text); }
.item-card h3 a:hover { color: var(--gold-bright); text-decoration: none; }

.item-card .desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.price-row .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.price-row .amount {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--gold-bright);
}

.countdown-chip {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.countdown-chip.ending-soon { color: var(--red-bright); }
.countdown-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.countdown-chip.ending-soon .dot { background: var(--red-bright); }

/* ---------- Item detail page ---------- */

.item-detail {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 860px) {
  .item-detail { grid-template-columns: 1fr; }
}

.item-detail .image-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4 / 3;
}
.item-detail .image-frame img { width: 100%; height: 100%; object-fit: cover; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.panel + .panel { margin-top: 20px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row .label { color: var(--text-muted); }
.stat-row .value { font-weight: 600; }
.stat-row .value.gold { color: var(--gold-bright); font-family: 'Fraunces', serif; font-size: 1.15rem; }

.countdown-big {
  display: flex;
  gap: 10px;
  margin: 6px 0 18px;
}
.countdown-big .unit {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 6px;
  text-align: center;
}
.countdown-big .unit .num {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
  display: block;
}
.countdown-big .unit .u {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bid-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.bid-form .amount-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 14px;
}
.bid-form .amount-input input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  padding: 12px 14px;
  font-family: 'Fraunces', serif;
}
.bid-form .amount-input input:focus { outline: none; }
.bid-form .amount-input .suffix {
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-left: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.own-bid-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.own-bid-note.leading { color: var(--green); }
.own-bid-note.outbid { color: var(--red-bright); }

/* ---------- Forms (auth, account, admin) ---------- */

.auth-shell {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 24px;
}
.auth-shell .panel { padding: 32px; }
.auth-shell h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-shell .sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 26px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
}
.field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 110px;
}
.field textarea:focus { outline: none; border-color: var(--gold); }
.field .hint-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 560px) { .form-row-2 { grid-template-columns: 1fr; } }

.form-foot {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---------- Alerts ---------- */

.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-error {
  background: rgba(139, 42, 42, 0.15);
  border-color: rgba(178, 58, 58, 0.4);
  color: #e3a9a9;
}
.alert-success {
  background: rgba(74, 139, 106, 0.15);
  border-color: rgba(74, 139, 106, 0.4);
  color: #a7d8c0;
}

/* ---------- Tables (admin) ---------- */

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.admin-table th, table.admin-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
table.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
}
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table .row-actions { display: flex; gap: 10px; }
table.admin-table img.thumb-sm {
  width: 52px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border);
}

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--gold);
}

.badge-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-status.live { background: rgba(74, 139, 106, 0.18); color: #7fc7a2; }
.badge-status.closed { background: rgba(154, 161, 174, 0.15); color: var(--text-muted); }

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.site-footer .gavel-mark-sm { width: 16px; height: 16px; opacity: 0.6; vertical-align: -3px; margin-right: 6px; }

main { flex: 1; }

@media (max-width: 640px) {
  .site-nav { gap: 14px; }
  .site-nav .user-tag { padding-left: 0; border-left: none; }
  .hero { padding: 50px 0 40px; }
}
