:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --muted: #6b6b6b;
  --gold: #b89b5e;
  --dark: #111827;
  --line: #e6e0d4;
  --soft: #faf8f3;
  --danger: #7f1d1d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #ffffff 0, var(--bg) 55%);
  color: var(--ink);
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(320px, 520px);
  gap: 48px;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.hero {
  max-width: 520px;
}

.hero-logo {
  width: 120px;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

.sofie-hero-card {
  width: min(320px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.14);
  background: #fff;
  margin-bottom: 22px;
}

.sofie-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
  margin: 0 0 20px;
  letter-spacing: -0.06em;
}

.hero p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.chat-shell {
  width: 100%;
  min-height: 680px;
  max-height: 780px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.12);
  overflow: hidden;
}

.chat-header {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  background: var(--dark);
  color: #fff;
}

.sofie-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.chat-brand-logo {
  width: 48px;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  margin-left: auto;
}

.chat-header strong {
  display: block;
  font-size: 16px;
}

.chat-header span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  margin-top: 2px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff, var(--soft));
}

.message {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 18px;
  margin-bottom: 12px;
  line-height: 1.45;
  font-size: 14px;
  white-space: pre-wrap;
}

.message.sofia {
  background: #f0ebe0;
  color: var(--ink);
  border-top-left-radius: 6px;
}

.message.user {
  background: var(--dark);
  color: #fff;
  margin-left: auto;
  border-top-right-radius: 6px;
}

.message.system {
  background: #fff7ed;
  color: #7c2d12;
  border: 1px solid #fed7aa;
  max-width: 100%;
  font-size: 13px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.quick-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--dark);
  font-weight: 600;
  font-size: 13px;
}

.quick-actions button:hover {
  border-color: var(--gold);
  color: #7c5f1c;
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-input input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
}

.chat-input input:focus {
  border-color: var(--gold);
}

.chat-input button {
  border: none;
  border-radius: 14px;
  padding: 0 18px;
  background: var(--gold);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
    padding: 28px 16px;
  }

  .chat-shell {
    min-height: 620px;
  }
}

.lead-button {
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--gold);
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

.lead-button:hover {
  filter: brightness(0.96);
}

.lead-form-card {
  max-width: 92%;
  width: min(560px, 92%);
}

.lead-form-title {
  font-weight: 900;
  color: #111827;
  margin-bottom: 4px;
}

.lead-form-subtitle {
  color: #6b7280;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.lead-form {
  display: grid;
  gap: 12px;
}

.lead-form label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #374151;
}

.lead-form input,
.lead-form select,
.lead-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: #111827;
  outline: none;
}

.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(190, 154, 73, 0.18);
}

.lead-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lead-consent {
  grid-template-columns: auto 1fr !important;
  align-items: start;
  font-weight: 600 !important;
  color: #4b5563 !important;
}

.lead-consent input {
  width: auto;
  margin-top: 3px;
}

.lead-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.lead-form-actions button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--gold);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}

.lead-form-actions button.secondary {
  background: #f3f4f6;
  color: #374151;
}

.lead-form-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .lead-form-actions {
    flex-direction: column;
  }
}

/* Sofie UI upgrade — commercial demo layer */
.hero-status {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.hero-status span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.04);
}

.hero-status strong {
  color: var(--dark);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.service-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
}

.service-grid strong {
  display: block;
  color: var(--dark);
  margin-bottom: 6px;
  font-size: 14px;
}

.service-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chat-disclaimer {
  margin: 0;
  padding: 10px 16px 0;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.quick-actions {
  align-items: center;
}

.quick-actions button {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.quick-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(184, 155, 94, 0.16);
}

.chat-input {
  flex-wrap: wrap;
}

.chat-input input {
  min-width: 220px;
}

.chat-input > button[type="submit"] {
  min-height: 46px;
}

.lead-button {
  flex: 1 0 100%;
  width: auto;
  margin-top: 0;
  min-height: 46px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16);
}

.lead-button:hover {
  filter: none;
  background: #000;
}

.message.assistant {
  background: #f0ebe0;
  color: var(--ink);
  border-top-left-radius: 6px;
}

.lead-form-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.lead-form-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.lead-form-card {
  max-width: 100%;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

.lead-form {
  display: grid;
  gap: 12px;
}

.lead-form label {
  display: grid;
  gap: 6px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
}

.lead-form input,
.lead-form select,
.lead-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-consent {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 10px !important;
  color: var(--muted) !important;
  font-weight: 500 !important;
}

.lead-consent input {
  margin-top: 3px;
}

.lead-privacy {
  color: #f8d7a6;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lead-privacy:hover,
.lead-privacy:focus-visible {
  color: #ffffff;
}

.lead-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-form-actions button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--gold);
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

.lead-form-actions button.secondary {
  background: #f3f4f6;
  color: var(--dark);
}

@media (max-width: 900px) {
  .hero-status span {
    flex-direction: column;
    gap: 4px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

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

  .chat-input button,
  .lead-button {
    width: 100%;
  }

  .lead-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Sofie UI v2 — premium dark demo layer */
body {
  background:
    radial-gradient(circle at 20% 10%, rgba(226, 179, 126, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(184, 155, 94, 0.10), transparent 30%),
    linear-gradient(135deg, #050505 0%, #111111 48%, #1b1710 100%);
  color: #e5e7eb;
}

.page {
  grid-template-columns: minmax(320px, 560px) minmax(360px, 620px);
  gap: 56px;
}

.hero {
  color: #f9fafb;
}

.hero-logo {
  background: #ffffff;
  border-radius: 16px;
  padding: 10px;
  width: 138px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.sofie-hero-card {
  border-radius: 36px;
  border: 1px solid rgba(226, 179, 126, 0.28);
  background: #111111;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.badge {
  background: rgba(226, 179, 126, 0.12);
  color: #e2b37e;
  border-color: rgba(226, 179, 126, 0.32);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  color: #ffffff;
  text-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.hero p {
  color: #c7c7c7;
}

.hero-status span,
.service-grid article {
  background: rgba(17, 17, 17, 0.78);
  border-color: rgba(226, 179, 126, 0.20);
  color: #a1a1aa;
  backdrop-filter: blur(18px);
}

.hero-status strong,
.service-grid strong {
  color: #f8d7a6;
}

.service-grid article {
  min-height: 118px;
}

.service-grid span {
  color: #b8b8bf;
}

.chat-shell {
  min-height: 760px;
  max-height: 860px;
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid rgba(226, 179, 126, 0.22);
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.50),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.chat-header {
  background:
    linear-gradient(135deg, #0a0a0a, #171717 55%, #2a2115);
  border-bottom: 1px solid rgba(226, 179, 126, 0.22);
}

.chat-header strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  color: #ffffff;
}

.chat-header span {
  color: #e2b37e;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sofie-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border-color: rgba(226, 179, 126, 0.55);
}

.chat-brand-logo {
  width: 58px;
  border-radius: 14px;
}

.chat-messages {
  background:
    radial-gradient(circle at top left, rgba(226, 179, 126, 0.10), transparent 35%),
    linear-gradient(180deg, #080808, #111111);
  padding: 24px;
}

.message {
  font-size: 14px;
  line-height: 1.55;
  padding: 15px 17px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.20);
}

.message.sofia,
.message.assistant {
  background: rgba(24, 24, 27, 0.92);
  color: #e5e7eb;
  border: 1px solid rgba(226, 179, 126, 0.16);
}

.message.user {
  background: linear-gradient(135deg, #e2b37e, #b89b5e);
  color: #111111;
  font-weight: 700;
}

.message.system {
  background: rgba(226, 179, 126, 0.10);
  color: #f8d7a6;
  border: 1px solid rgba(226, 179, 126, 0.22);
}

.quick-actions {
  background: #0f0f0f;
  border-top: 1px solid rgba(226, 179, 126, 0.18);
  padding: 16px;
}

.quick-actions button {
  background: #18181b;
  color: #e5e7eb;
  border-color: rgba(226, 179, 126, 0.18);
}

.quick-actions button:hover {
  background: rgba(226, 179, 126, 0.12);
  color: #f8d7a6;
  border-color: rgba(226, 179, 126, 0.5);
}

.chat-disclaimer {
  background: #0f0f0f;
  color: #a1a1aa;
  border-top: 1px solid rgba(226, 179, 126, 0.14);
}

.chat-input {
  background: #0f0f0f;
  border-top: 1px solid rgba(226, 179, 126, 0.18);
}

.chat-input input {
  background: #050505;
  border-color: rgba(226, 179, 126, 0.20);
  color: #f9fafb;
}

.chat-input input::placeholder {
  color: #71717a;
}

.chat-input input:focus {
  border-color: #e2b37e;
  box-shadow: 0 0 0 3px rgba(226, 179, 126, 0.12);
}

.chat-input button[type="submit"] {
  background: linear-gradient(135deg, #e2b37e, #b89b5e);
  color: #111111;
}

.lead-button {
  background: #ffffff;
  color: #111111;
}

.lead-button:hover {
  background: #f8d7a6;
}

.lead-form-card {
  background: rgba(24, 24, 27, 0.98) !important;
  color: #e5e7eb !important;
  border-color: rgba(226, 179, 126, 0.24);
}

.lead-form-title {
  color: #f8d7a6;
}

.lead-form-subtitle,
.lead-consent {
  color: #b8b8bf !important;
}

.lead-form label {
  color: #e5e7eb;
}

.lead-form input,
.lead-form select,
.lead-form textarea {
  background: #050505;
  color: #f9fafb;
  border-color: rgba(226, 179, 126, 0.20);
}

.lead-form-actions button {
  background: linear-gradient(135deg, #e2b37e, #b89b5e);
  color: #111111;
}

.lead-form-actions button.secondary {
  background: #27272a;
  color: #e5e7eb;
}

@media (max-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    width: 100%;
    padding: 28px 16px;
  }

  .hero-logo {
    width: 112px;
  }

  .hero,
  .chat-shell {
    min-width: 0;
    max-width: 100%;
  }

  .chat-shell {
    min-height: 680px;
  }
}
