/* Liveloop app — design system A (light editorial).
   All visual tokens live in :root — restyle the whole app from here. */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #1a1714;
  --muted: #6f6a63;
  --line: #e6e3dc;
  --accent: #c4502d;
  --accent-soft: #f6e9e3;
  --ok: #2f8f5b;
  --radius: 14px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: "Fraunces", Georgia, serif; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .92rem; padding: .6rem 1.05rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: var(--accent); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-sm { padding: .4rem .8rem; font-size: .82rem; }
.btn-block { display: flex; width: 100%; }

/* Tables (super-admin) */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.error-note { margin: 0 0 12px; padding: 9px 14px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; font-size: .85rem; }

/* Header / footer */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: "Fraunces", serif; font-weight: 600; font-size: 1.2rem; }
.brand-mark { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); }
.site-header nav { display: flex; gap: 1.2rem; align-items: center; }
.site-header nav a { color: var(--muted); font-weight: 500; font-size: .92rem; }
.site-header nav a:hover { color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0; color: var(--muted); font-size: .85rem; }

main { padding: 36px 0 20px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* Cards & forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
input, select, textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 120px; }

/* Webinar list */
.webinar-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 8px; }
.webinar-card { display: flex; flex-direction: column; gap: 10px; }
.webinar-card h3 { font-size: 1.15rem; }
.webinar-card .slug { font-size: .78rem; color: var(--muted); font-family: ui-monospace, monospace; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
.badge-live { background: #fdece7; color: var(--accent); }
.badge-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.badge-wait { background: #eef0ee; color: var(--muted); }
.price { font-family: "Fraunces", serif; }
.price s { color: var(--muted); margin-right: 6px; }
.price .free { color: var(--ok); }

/* ---- Webinar room ---- */
.room { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.stage-wrap { display: flex; flex-direction: column; gap: 14px; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #0d0c0b; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0d0c0b; }
.stage-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent); color: #fff; font-size: .82rem; pointer-events: none; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .08em; }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; animation: pulse 1.6s infinite; }
.viewers { margin-left: auto; }
.unmute { position: absolute; bottom: 14px; left: 14px; background: rgba(255,255,255,.92); color: var(--ink); border: 0; border-radius: 999px; padding: .45rem .9rem; font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer; }
.waiting { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: "Fraunces", serif; font-size: 1.4rem; background: #0d0c0b; }

/* Offer box (entry price / CTA) */
.offer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.offer .price { font-size: 1.5rem; }

/* Chat */
.chat { display: flex; flex-direction: column; height: min(72vh, 640px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; }
.messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { font-size: .9rem; line-height: 1.4; animation: fade .25s var(--ease); }
.msg b { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 1px; }
.msg.ai b { color: var(--accent); }
.msg.host b { color: var(--ink); }
.chat-form { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { padding: .5rem .6rem; font-size: .88rem; }
.blocked-note { margin: 0; padding: 8px 16px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .room { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
  .chat { height: 60vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .btn:hover { transform: none; }
  .badge-live i, .live-badge i { animation: none; }
}
