:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfe;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #0f946b;
  --warning: #b7791f;
  --danger: #c2410c;
  --shadow: 0 18px 45px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; font-weight: 700; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { margin: 0; line-height: 1.16; letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 14px; }

input, textarea, select, button { font: inherit; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
textarea { min-height: 128px; resize: vertical; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
}
.topbar strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.topbar strong::before {
  content: "EW";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.topbar nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--text);
  padding: 9px 11px;
  border-radius: 8px;
}
.topbar nav a:hover { background: var(--primary-soft); color: var(--primary-dark); }

.container { max-width: 1180px; margin: 34px auto; padding: 0 22px; }
.narrow { max-width: 880px; }
.auth-shell, .public-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.auth-card {
  width: min(440px, 100%);
  padding: 34px;
}
.auth-card h1 { margin-bottom: 22px; }
.auth-card::before {
  content: "Evergreen Webinar";
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

label {
  display: block;
  margin-bottom: 14px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}
label input, label textarea, label select { margin-top: 7px; font-weight: 500; }

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 15px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.button:hover, button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(16, 24, 40, .08); }
.button.primary, button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover, button.primary:hover { background: var(--primary-dark); }

.alert {
  padding: 13px 15px;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e3a8a;
  font-weight: 700;
}
.muted { color: var(--muted); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.toolbar h1 { margin-bottom: 4px; }
.toolbar::after {
  content: "Manage registrations, embeds, chat, and offers from one place.";
  color: var(--muted);
  margin-right: auto;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.grid .panel {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}
.grid .panel h2 { margin-bottom: 9px; }
.grid .panel p:nth-of-type(2) {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.grid .panel p strong {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}
.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #344054;
}
.actions a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.inline-form { display: inline; }
.link-button {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  border: 1px dashed #b8c3d4;
  background: #fff;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid label { margin: 0; }
.full { grid-column: 1 / -1; }
.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.checkbox input { width: auto; margin: 0; }
.codebox {
  min-height: 160px;
  font-family: Consolas, "SFMono-Regular", monospace;
  background: #111827;
  color: #dbeafe;
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stats .panel { padding: 20px; }
.stats strong { display: block; font-size: 32px; color: var(--primary-dark); }
.stats span { color: var(--muted); font-weight: 700; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 13px 14px; vertical-align: top; }
th { background: #f2f6fb; color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }

.public-card {
  width: min(700px, 100%);
  text-align: center;
  padding: 38px;
}
.public-card h1 { margin-bottom: 10px; }
.public-card h2 { color: var(--primary-dark); margin-bottom: 16px; }
.countdown {
  display: inline-flex;
  margin: 12px 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--success);
  font-size: 24px;
  font-weight: 900;
}

.webinar-room {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  background: #0b1120;
  color: #fff;
}
.video-stage { padding: 28px; }
.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.video-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.waiting {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 22, .94);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
}
.waiting h1 { margin-bottom: 10px; }
.hidden { display: none !important; }
.room-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}
.room-meta h1 { margin-bottom: 8px; }
.room-meta p { color: #cbd5e1; margin: 0; }
.chat-panel {
  background: #fff;
  color: var(--text);
  padding: 22px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, .08);
}
.chat-panel h2 {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.chat-feed { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.chat-message {
  padding: 11px 12px;
  border-radius: 8px;
  background: #f2f6fb;
  border: 1px solid #e6ebf3;
}
.chat-message strong { display: block; margin-bottom: 3px; color: #1f2937; }
.chat-message span { color: #344054; }
.role-host { background: #eaf1ff; border-left: 4px solid var(--primary); }
.role-system { background: #fff7ed; border-color: #fed7aa; color: var(--warning); font-style: italic; }

@media (max-width: 900px) {
  .topbar { position: static; padding: 14px 16px; align-items: flex-start; flex-direction: column; }
  .container { margin: 24px auto; padding: 0 16px; }
  .toolbar, .room-meta { align-items: flex-start; flex-direction: column; }
  .toolbar::after { content: ""; display: none; }
  .form-grid, .stats { grid-template-columns: 1fr; }
  .webinar-room { grid-template-columns: 1fr; }
  .video-stage { padding: 16px; }
  .chat-panel { min-height: 380px; }
}

@media (max-width: 560px) {
  h1 { font-size: 25px; }
  .auth-card, .public-card, .panel { padding: 20px; }
  .actions { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
