/* Import Google Font Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Light Mode Theme Variables from CODEX_UI_THEME_REFERENCE.md */
  --bg: #ffffff;
  --page-gradient: #ffffff;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --surface-elevated: #ffffff;
  --surface-overlay: #ffffff;
  --border: #e8e8e8;
  --border-strong: #dfdfdf;
  --text: #000000;
  --text-muted: #666666;
  --heading: #000000;
  --primary: #e05322;
  --primary-soft: rgba(224, 83, 34, 0.08);
  --primary-gradient: #e05322;
  --accent: #e05322;
  --accent-soft: rgba(224, 83, 34, 0.08);
  --success: #4caf50;
  --success-soft: rgba(76, 175, 80, 0.08);
  --danger: #df514c;
  --danger-soft: rgba(223, 81, 76, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.09);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.05);
  --radius-sm: 4px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --input-bg: #ffffff;
  --input-border: #e8e8e8;
  --input-shadow: 0 0 0 2px rgba(224, 83, 34, 0.15);
  --row-hover: #fafafa;

  /* Legacy variable mapping to preserve existing css classes compatibility */
  --bg-1: var(--bg);
  --bg-2: var(--surface-muted);
  --muted: var(--text-muted);
  --line: var(--border);
  --glass: var(--surface);
  --glass-strong: var(--surface-elevated);
  --accent-2: #3b82f6;
  --shadow: var(--shadow-sm);
  --radius-xl: 4px;
  --radius-lg: 4px;
  --radius-md: 4px;
}

html[data-theme="dark"] {
  /* Dark Mode Theme Variables from CODEX_UI_THEME_REFERENCE.md */
  --bg: #161922;
  --page-gradient: #161922;
  --surface: #191c24;
  --surface-muted: #212431;
  --surface-elevated: #1e222b;
  --surface-overlay: #1e222b;
  --border: #2d323f;
  --border-strong: #383e4d;
  --text: #cbd5e1;
  --text-muted: #8e9db0;
  --heading: #ffffff;
  --primary: #f05a28;
  --primary-soft: rgba(240, 90, 40, 0.1);
  --primary-gradient: #f05a28;
  --accent: #f05a28;
  --accent-soft: rgba(240, 90, 40, 0.1);
  --success: #00b852;
  --success-soft: rgba(0, 184, 82, 0.1);
  --danger: #ff5722;
  --danger-soft: rgba(255, 87, 34, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
  --radius-sm: 4px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --input-bg: #161922;
  --input-border: #2d323f;
  --input-shadow: 0 0 0 2px rgba(240, 90, 40, 0.18);
  --row-hover: #212431;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body.meeting-body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Hide orbs and grids to match CODEX_UI_THEME_REFERENCE.md */
.bg-orb,
.bg-grid {
  display: none !important;
}

.glass-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-sm);
}

.topbar,
.page-shell,
.modal {
  position: relative;
  z-index: 1;
}

.topbar {
  margin: 22px auto 0;
  width: min(1180px, calc(100% - 24px));
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 154px;
  height: auto;
  object-fit: contain;
  filter: none; /* remove light shadow */
}

/* Dark theme logo styling if needed */
html[data-theme="dark"] .brand-logo {
  filter: brightness(0.9) invert(1) hue-rotate(180deg); /* basic invert to make logo look good in dark mode */
}

.nav-action,
.primary-btn,
.secondary-btn {
  border-radius: var(--radius-sm);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.nav-action {
  padding: 10px 20px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.nav-action:hover {
  background: var(--primary-gradient);
  opacity: 0.9;
}

.page-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 54px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
}

.hero-visual {
  padding: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.hero-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 10px 0 22px;
}

.hero-kicker,
.status-copy,
.form-feedback,
.modal-kicker,
.join-status-title,
.join-status-copy,
.waiting-title,
.event-label {
  margin: 0;
}

.hero-kicker,
.modal-kicker,
.event-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-copy h1 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--heading);
  font-weight: 800;
}

.poster-frame {
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.poster-frame-wide {
  max-width: 760px;
  margin: 0 auto;
}

.poster-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.hero-actions-center {
  margin-top: 18px;
}

.primary-btn,
.secondary-btn,
.form-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.primary-btn:hover {
  opacity: 0.95;
}

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  background: var(--surface-muted);
}

.event-strip {
  margin: 18px auto 0;
  max-width: 820px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.event-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 1.03rem;
  color: var(--text);
}

.status-copy {
  max-width: 820px;
  margin: 16px auto 0;
  text-align: center;
  color: var(--muted);
}

.status-copy-center {
  padding-bottom: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.modal-card {
  position: relative;
  width: min(540px, 100%);
  padding: 24px;
  border-radius: var(--radius-lg);
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: background 150ms ease;
}

.close-btn:hover {
  background: var(--surface-muted);
}

.modal-header h2 {
  margin: 10px 0 10px;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--heading);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-instruction {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 14px 0 0;
}

.register-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  max-height: min(62vh, 440px);
  overflow-y: auto;
  padding-right: 6px;
}

.register-form::-webkit-scrollbar {
  width: 6px;
}

.register-form::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-sm);
}

.register-form label {
  display: grid;
  gap: 6px;
}

.register-form span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.register-form input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.register-form input:focus {
  border-color: var(--primary);
  box-shadow: var(--input-shadow);
}

.form-btn {
  margin-top: 6px;
  width: 100%;
}

.form-feedback {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.waiting-popup {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 2;
}

.waiting-popup-card {
  width: min(480px, 100%);
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.waiting-popup-copy {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.meeting-shell {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 24px));
  margin: 22px auto;
  min-height: calc(100vh - 44px);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 42px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.meeting-copy {
  display: grid;
  gap: 14px;
  align-content: center;
}

.meeting-logo {
  width: 150px;
  height: auto;
  object-fit: contain;
}

.meeting-copy h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: var(--heading);
  font-weight: 800;
}

.meeting-status {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  line-height: 1.6;
}

.meeting-card {
  padding: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  border: none;
  box-shadow: none;
}

.meeting-card-inner {
  min-height: 240px;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.meeting-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meeting-card strong {
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--text);
  font-weight: 800;
}

.meeting-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -14px, 0) scale(1.04);
  }
}

@media (max-width: 900px) {
  .topbar {
    width: min(100%, calc(100% - 16px));
    border-radius: var(--radius-sm);
    padding: 12px 14px;
  }

  .brand-logo {
    width: 130px;
  }

  .page-shell {
    width: min(100%, calc(100% - 16px));
    margin-top: 14px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .meeting-shell {
    width: min(100%, calc(100% - 16px));
    grid-template-columns: 1fr;
    min-height: calc(100vh - 32px);
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .hero-visual,
  .modal-card {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .hero-copy h1 {
    font-size: clamp(1.6rem, 10vw, 2.5rem);
  }

  .poster-frame {
    padding: 8px;
    border-radius: var(--radius-lg);
  }

  .poster-image {
    border-radius: var(--radius-sm);
  }
}
