/* demo.st — landing page */

:root {
  --bg: #0c0c0c;
  --bg-elevated: #141414;
  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.15);
  --border: #262626;
  --radius: 12px;
  --font-head: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.logo {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

/* Mobile: collapse nav links into "More" dropdown (guest only) */
.nav-more {
  display: none;
  position: relative;
}

.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  background: none;
  border: none;
  padding: 0.5rem 0;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.2s;
}

.nav-more-btn:hover {
  color: var(--text);
}

.nav-more-btn::after {
  content: '';
  width: 0.4em;
  height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-bottom: 0.15em;
  transition: transform 0.2s;
}

.nav-more.open .nav-more-btn::after {
  transform: rotate(-135deg);
  margin-bottom: -0.2em;
}

.nav-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 11rem;
  padding: 0.5rem 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.nav-more-menu[hidden] {
  display: none !important;
}

.nav-more-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav-more-menu a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

@media (max-width: 767px) {
  .nav-more.nav-guest-only {
    display: block;
  }
  .nav .nav-link.nav-guest-only {
    display: none;
  }
}

@media (min-width: 768px) {
  .nav-more {
    display: none;
  }
  .nav .nav-link {
    display: inline;
  }
}

body.user-authenticated .nav .nav-guest-only {
  display: none;
}

/* Nav: Sign in = notable green button; Sign out / Coming soon = text-style */
.nav .btn-ghost {
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 400;
}

.nav .btn-ghost:hover {
  color: var(--text);
  background: none;
}

.nav .btn-signin {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.2s;
}

.nav .btn-signin:hover {
  filter: brightness(1.12);
  color: var(--bg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.btn-ghost {
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn:disabled,
.btn[disabled] {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.85;
  filter: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background: var(--border);
  color: var(--text-muted);
}

/* Hero */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem 4rem;
}

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
    padding: 3rem 2rem 4rem;
    max-width: 72rem;
    margin: 0 auto;
  }
}

.hero-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-dim), transparent),
    radial-gradient(ellipse 70% 60% at 100% 30%, rgba(74, 222, 128, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(74, 222, 128, 0.04), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 42rem;
}

@media (min-width: 900px) {
  .hero-content {
    max-width: none;
  }
}

.hero-label {
  font-size: 0.875rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero-title-accent {
  color: var(--accent);
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 36rem;
  margin: 0 0 2rem;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 500;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.hero-cta .btn-primary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.hero-cta-note {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Authenticated: compact hero + hide CTA + hide sections below subdomain */
body.user-authenticated .hero {
  min-height: 0;
  padding: 1.5rem 1.5rem 2rem;
}
body.user-authenticated .hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}
body.user-authenticated .hero-lead {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}
body.user-authenticated .hero-cta {
  display: none;
}
body.user-authenticated .hero-cta-note {
  display: none;
}
@media (min-width: 900px) {
  body.user-authenticated .hero {
    padding: 1.5rem 2rem 2.5rem;
    gap: 1.5rem;
    grid-template-columns: 1fr;
  }
}
body.user-authenticated .subdomain-dashboard {
  padding: 2rem 1.5rem 2.5rem;
}
body.user-authenticated .subdomain-dashboard-title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}
body.user-authenticated .subdomain-reserve-lead,
body.user-authenticated .subdomain-reserve-row {
  margin-bottom: 0.75rem;
}
body.user-authenticated .subdomain-owned-value {
  margin-top: 0.25rem;
}
body.user-authenticated .hero-visual {
  display: none;
}
body.user-authenticated #how,
body.user-authenticated #who,
body.user-authenticated #features,
body.user-authenticated #coming,
body.user-authenticated .site-footer {
  display: none !important;
}

.hero-visual {
  display: none;
}

@media (min-width: 900px) {
  .hero-visual {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    min-height: 200px;
  }
}

/* Browser-style mockup for balance and focus */
.url-mockup {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.url-mockup-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid var(--border);
}

.url-mockup-dots {
  display: flex;
  gap: 4px;
}

.url-mockup-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.url-mockup-dots span:nth-child(1) { background: #3d3d3d; }
.url-mockup-dots span:nth-child(2) { background: #3d3d3d; }
.url-mockup-dots span:nth-child(3) { background: #3d3d3d; }

.url-mockup-field {
  flex: 1;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-left: 0.5rem;
}

.url-subdomain {
  color: var(--accent);
  transition: opacity 0.2s ease;
}

.url-subdomain.subdomain-fade-out {
  opacity: 0;
}

.url-subdomain.subdomain-fade-in {
  opacity: 1;
}

.url-domain {
  color: var(--text-muted);
}

.url-mockup-preview {
  height: 120px;
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.03) 0%, transparent 50%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.url-mockup-preview-inner {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}


/* Subdomain dashboard (authenticated) */
.subdomain-dashboard {
  padding: 3rem 1.5rem 4rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.subdomain-dashboard-inner {
  position: relative;
  max-width: 56rem;
  margin: 0 auto;
}

.subdomain-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(12, 12, 12, 0.85);
  border-radius: var(--radius);
}

.subdomain-loading:not([hidden]) {
  display: flex;
}

.subdomain-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: subdomain-spin 0.7s linear infinite;
}

@keyframes subdomain-spin {
  to { transform: rotate(360deg); }
}

.subdomain-loading-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

@media (min-width: 900px) {
  body.user-authenticated .subdomain-dashboard-inner {
    max-width: 72rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.subdomain-dashboard-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.subdomain-reserve-lead {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 0.75rem;
}

.subdomain-reserve-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.subdomain-input {
  width: 100%;
  max-width: 14rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}

.subdomain-input:focus {
  border-color: var(--accent);
}

.subdomain-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.subdomain-suffix {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.subdomain-error {
  font-size: 0.875rem;
  color: #f87171;
  margin: 0;
}

.subdomain-owned-value {
  font-size: 1.125rem;
  color: var(--text);
  margin: 0;
}

.subdomain-owned-value strong {
  color: var(--accent);
  font-weight: 600;
}

.subdomain-owned-value .subdomain-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.subdomain-owned-value .subdomain-link:hover {
  text-decoration: underline;
}

.subdomain-owned-value .subdomain-link .subdomain-link-icon {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.35em;
  vertical-align: middle;
  opacity: 0.9;
}

.subdomain-status-msg {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.subdomain-actions {
  margin-top: 1.25rem;
}

.subdomain-upload-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.subdomain-upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.subdomain-drop-zone {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}

.subdomain-drop-zone:hover {
  border-color: var(--text-muted);
}

.subdomain-drop-zone.drop-zone-active {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.06);
}

.subdomain-drop-zone.drop-zone-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.subdomain-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.subdomain-file-label {
  font-size: 0.9375rem;
  color: var(--text-muted);
  pointer-events: none;
}

.subdomain-upload-form .btn {
  flex-shrink: 0;
}

.subdomain-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.subdomain-release {
  color: var(--text-muted);
}

.subdomain-release:hover {
  color: #f87171;
}

/* Section */
.section {
  padding: 4rem 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.section-lead {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 40rem;
  margin: 0 0 2rem;
  line-height: 1.55;
}

/* Icons */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex-shrink: 0;
}

.step-icon,
.persona-icon,
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.step-icon .icon,
.feature-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.persona-icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  position: relative;
  padding: 1.5rem;
  padding-top: 4.25rem;
  padding-right: 2.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.03);
}

.step-icon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 2.5rem;
  height: 2.5rem;
}

.step-num {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.step h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
  padding-right: 0;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* MCP config box (How it works) */
.mcp-config-box {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mcp-config-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.mcp-config-lead {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.mcp-config-url-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
}

.mcp-config-url {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  word-break: break-all;
}

.mcp-config-copy {
  font-size: 0.8125rem;
  padding: 0.4rem 0.6rem;
}

.mcp-config-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.mcp-config-meta a {
  color: var(--accent);
}

.mcp-config-meta a:hover {
  text-decoration: underline;
}

/* MCP token dashboard (authenticated, below subdomain) */
.mcp-token-dashboard {
  padding: 2rem 1.5rem 3rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.mcp-token-dashboard-inner {
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  body.user-authenticated .mcp-token-dashboard-inner {
    max-width: 72rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.mcp-token-dashboard-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.mcp-token-dashboard-lead {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.mcp-token-dashboard-lead code {
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.mcp-token-dashboard-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
}

.mcp-token-value {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  word-break: break-all;
  display: block;
}

.mcp-token-dashboard-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.mcp-token-dashboard-meta a {
  color: var(--accent);
}

.mcp-token-dashboard-meta a:hover {
  text-decoration: underline;
}

.hero-cta-link {
  color: var(--accent);
}

.hero-cta-link:hover {
  text-decoration: underline;
}

.step code {
  display: inline;
  font-size: 0.875em;
  padding: 0.2em 0.45em;
  background: rgba(74, 222, 128, 0.12);
  border-radius: 4px;
  color: var(--accent);
  font-weight: 500;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

/* Who it's for */
.personas {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .personas {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .personas {
    grid-template-columns: repeat(4, 1fr);
  }
}

.persona {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.persona-icon {
  margin-bottom: 1rem;
}

.persona h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.persona p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.persona-url {
  font-size: 0.8125rem;
  padding: 0.25em 0.5em;
  background: var(--bg);
  border-radius: 4px;
  color: var(--accent);
}

/* Features */
.features-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 500px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-icon {
  margin-bottom: 1rem;
}

.feature h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.feature code {
  font-size: 0.875em;
  padding: 0.15em 0.35em;
  background: var(--bg);
  border-radius: 4px;
  color: var(--accent);
}

/* CTA */
.cta-box {
  padding: 2.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.cta-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.375rem;
  margin: 0 0 1rem;
}

.cta-box p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-sub {
  font-size: 0.9375rem;
  margin-top: 1rem !important;
}

/* Footer */
.site-footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.logo-inline {
  font-family: var(--font-head);
  font-weight: 600;
}

.logo-inline:hover .logo-dot {
  opacity: 0.9;
}

/* Auth pages */
.auth-page {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-form {
  width: 100%;
  max-width: 360px;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth-form h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}

.auth-form label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.auth-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-form .btn-primary {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.auth-form .error {
  font-size: 0.875rem;
  color: #f87171;
  margin-bottom: 1rem;
}

.auth-form .auth-link {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-form .auth-link a {
  color: var(--accent);
}

.welcome-box {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.welcome-box h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.welcome-box .email {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.welcome-box .btn {
  margin-top: 0.5rem;
}

/* Auth overlay (modal) */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.auth-overlay-dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.auth-overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s;
}

.auth-overlay-close:hover {
  color: var(--text);
}

.auth-overlay-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 1rem;
  padding-right: 2rem;
}

.auth-embed {
  max-width: 360px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-error {
  font-size: 0.875rem;
  color: #f87171;
  margin-bottom: 1rem;
}

.auth-terms {
  margin-bottom: 1rem;
}

/* Verify step: balanced spacing above/below the ToC row */
.auth-terms-verify {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.auth-terms-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.5;
}

.auth-terms-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  top: 0.12em;
  cursor: pointer;
  accent-color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elevated);
  transition: border-color 0.15s, background 0.15s;
}

.auth-terms-label input[type="checkbox"]:hover {
  border-color: var(--text-muted);
}

.auth-terms-label input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0c0c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-terms-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-terms-label a {
  color: var(--accent);
}

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-oauth-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-oauth .btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  box-sizing: border-box;
}

.auth-oauth .btn-oauth:hover {
  background: var(--bg-soft);
  border-color: var(--text-muted);
}

.auth-disclaimer,
.auth-oauth-disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}
.auth-disclaimer a,
.auth-oauth-disclaimer a {
  color: var(--accent);
}
.auth-disclaimer a:hover,
.auth-oauth-disclaimer a:hover {
  text-decoration: underline;
}

.btn-oauth-google {
  background: #fff !important;
  color: #1f1f1f !important;
  border-color: #dadce0 !important;
}

.btn-oauth-google:hover {
  background: #f8f9fa !important;
  border-color: #dadce0 !important;
}

.btn-oauth-github {
  background: #24292f !important;
  color: #fff !important;
  border-color: #24292f !important;
}

.btn-oauth-github:hover {
  background: #32383f !important;
  border-color: #32383f !important;
}

.auth-divider {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.75rem 0 1rem;
}

.auth-password-message {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.auth-back-email {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.auth-form-inline label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.auth-form-inline input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.auth-form-inline input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-form-inline .btn-primary {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.25rem;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user-email {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user .btn-signout {
  cursor: pointer;
}

.nav-user[hidden] {
  display: none !important;
}

/* Notifications (toast) — reusable */
.notifications {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
  pointer-events: none;
}

.notification {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification--visible {
  opacity: 1;
  transform: translateY(0);
}

.notification--success {
  border-left: 3px solid var(--accent);
}

.notification--error {
  border-left: 3px solid #f87171;
}

.notification--info {
  border-left: 3px solid var(--text-muted);
}
