:root {
  color-scheme: dark;
  --bg: #05030a;
  --surface: #0e0a17;
  --surface-2: #17111f;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f7f5fb;
  --muted: #bdb4c9;
  --magenta: #b20d5d;
  --teal: #5cdfe6;
  --lime: #3fe82e;
  --danger: #ff4f78;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--magenta);
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #241a2f;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.danger-button {
  background: var(--danger);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(5, 3, 10, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 156px;
  max-width: 44vw;
  height: auto;
}

.brand span {
  color: var(--teal);
  letter-spacing: 0;
}

.topnav {
  display: flex;
  gap: 8px;
}

.topnav a {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.topnav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  min-height: calc(100vh - 78px);
}

.login-visual {
  display: flex;
  align-items: flex-end;
  min-height: 540px;
  padding: clamp(24px, 6vw, 72px);
  background-position: center;
  background-size: cover;
  position: relative;
}

.login-visual::before,
.listen-stage::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(5, 3, 10, 0.92), rgba(5, 3, 10, 0.46));
}

.login-visual > div,
.listen-content {
  position: relative;
}

.login-visual h1,
.listen-content h1,
.room-hero h1 {
  margin: 6px 0 12px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.login-visual p,
.room-hero p,
.listen-content p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  align-items: center;
  padding: clamp(20px, 4vw, 56px);
  background: var(--surface);
}

.auth-form,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 18px;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 30px;
}

.auth-form h2,
.panel h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.form-error {
  margin: 0;
  color: #ffc0d0;
}

label,
.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #090610;
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.room-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.room-hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.broadcast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill.offline {
  color: #ffd6df;
  background: rgba(255, 79, 120, 0.16);
}

.status-pill.live {
  color: #d9ffd3;
  background: rgba(63, 232, 46, 0.14);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.meter-shell {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #05030a;
  border: 1px solid var(--line);
}

.meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  transition: width 80ms linear;
}

.status-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.status-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.status-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-list dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.qr-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.qr {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.listen-url {
  color: var(--teal);
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}

.listen-layout {
  min-height: calc(100vh - 78px);
}

.listen-stage {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: clamp(24px, 7vw, 90px);
  background-position: center;
  background-size: cover;
}

.listen-content {
  width: min(640px, 100%);
}

.listen-logo {
  width: min(300px, 82vw);
  height: auto;
  margin-bottom: 22px;
}

.listen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}

.listen-actions button {
  margin: 0;
}

audio {
  display: block;
  width: min(100%, 520px);
  margin-top: 8px;
}

.listener-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--danger);
}

.dot.live {
  background: var(--lime);
  box-shadow: 0 0 0 6px rgba(63, 232, 46, 0.14);
}

@media (max-width: 840px) {
  .login-layout,
  .broadcast-grid {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 360px;
  }

  .room-hero {
    display: grid;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .brand img {
    width: 136px;
  }

  .status-list {
    grid-template-columns: 1fr;
  }

  .button-row > button {
    width: 100%;
  }
}
