:root {
  color-scheme: dark;
  --bg: #202123;
  --bg-elevated: rgba(52, 53, 65, 0.86);
  --bg-soft: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ececf1;
  --text-soft: #b5b7c4;
  --accent: #19c37d;
  --accent-strong: #10a36a;
  --danger-soft: #3d2f39;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(25, 195, 125, 0.16), transparent 25%),
    linear-gradient(180deg, #16171a 0%, #202123 36%, #151618 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 24px;
}

.glass-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel,
.control-panel {
  padding: 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.hero-panel h1,
.panel-header h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.03;
}

.panel-header h2 {
  font-size: 1.6rem;
}

.hero-copy {
  margin: 18px 0 26px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 38rem;
}

.chat-preview {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-preview__header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(25, 195, 125, 0.14);
}

.chat-bubble {
  padding: 16px 18px;
  border-radius: 20px;
  line-height: 1.6;
}

.chat-bubble--user {
  background: rgba(255, 255, 255, 0.07);
  justify-self: end;
  max-width: 90%;
}

.chat-bubble--assistant {
  background: rgba(25, 195, 125, 0.14);
  color: #def8ec;
}

.countdown-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(25, 195, 125, 0.16), rgba(16, 163, 106, 0.04));
  border: 1px solid rgba(25, 195, 125, 0.3);
}

.countdown-card__label,
.countdown-card__meta {
  color: var(--text-soft);
}

.countdown-card__timer {
  font-size: 1.75rem;
  font-weight: 800;
}

.panel-header,
.provider-section__header,
.cta-row,
.field-grid,
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.share-form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span:first-child {
  color: var(--text-soft);
  font-size: 0.94rem;
  font-weight: 600;
}

textarea,
select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(15, 16, 18, 0.62);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.55;
}

textarea:focus,
select:focus {
  border-color: rgba(25, 195, 125, 0.8);
  box-shadow: 0 0 0 4px rgba(25, 195, 125, 0.12);
  transform: translateY(-1px);
}

.toggle-field {
  align-content: start;
}

.toggle-button {
  width: 68px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
  position: relative;
  transition: background 180ms ease;
}

.toggle-button__thumb {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 50%;
  background: #fff;
  transform: translateX(0);
  transition: transform 180ms ease;
}

.toggle-button[data-active='true'] {
  background: rgba(25, 195, 125, 0.9);
}

.toggle-button[data-active='true'] .toggle-button__thumb {
  transform: translateX(28px);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--accent);
  color: #052e1d;
  flex: 1;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.ghost-button {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.share-link-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.share-link-box__label {
  color: var(--text-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.share-link-box__value {
  display: inline-block;
  margin-top: 8px;
  color: #8fe9bf;
  text-decoration: none;
  line-height: 1.6;
  word-break: break-all;
}

.provider-section {
  margin-top: 24px;
}

.provider-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.provider-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.provider-card__head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.provider-card__title {
  margin: 0;
  font-size: 1rem;
}

.provider-card__subtitle,
.provider-card__notes {
  margin: 6px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge--good {
  background: rgba(25, 195, 125, 0.16);
  color: #9ff0ca;
}

.badge--muted {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-soft);
}

.hidden {
  display: none;
}

body.flash-success .share-link-box {
  box-shadow: 0 0 0 2px rgba(25, 195, 125, 0.24);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .hero-panel,
  .control-panel {
    padding: 22px;
  }

  .field-grid,
  .cta-row,
  .panel-header,
  .provider-section__header,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

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