:root {
  --ink: #09090b;
  --primary: #18181b;
  --secondary: #52525b;
  --accent: #ec4899;
  --accent-dark: #be185d;
  --paper: #fafafa;
  --white: #fff;
  --muted: #f1f1f3;
  --border: #e4e4e7;
  --danger: #b91c1c;
  font-family: "Nunito Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(236, 72, 153, .28); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 42%) 1fr; }
.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px clamp(32px, 5vw, 76px); color: var(--white); background: var(--primary); isolation: isolate; }
.brand-mark, .assistant-avatar, .mobile-brand span { display: grid; place-items: center; font-family: Rubik, sans-serif; font-weight: 700; color: var(--white); background: var(--accent); }
.brand-mark { width: 52px; height: 52px; border-radius: 15px 5px 15px 15px; font-size: 26px; }
.brand-copy { max-width: 590px; }
.eyebrow, .step-label { margin: 0 0 12px; color: #f9a8d4; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-copy h1 { margin: 0; font: 600 clamp(42px, 5vw, 72px)/1.02 Rubik, sans-serif; letter-spacing: -.04em; }
.brand-copy > p:last-child { max-width: 490px; margin: 28px 0 0; color: #d4d4d8; font-size: 18px; line-height: 1.65; }
.feature-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-strip span { padding: 9px 12px; border: 1px solid #3f3f46; border-radius: 999px; color: #e4e4e7; font-size: 13px; }
.orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(1px); opacity: .8; }
.orb-one { width: 280px; height: 280px; right: -120px; top: 12%; border: 70px solid #831843; }
.orb-two { width: 120px; height: 120px; left: -50px; bottom: 18%; background: #3f3f46; }

.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; background: radial-gradient(circle at 85% 12%, #fce7f3 0, transparent 25%), var(--paper); }
.workspace-header { display: flex; justify-content: flex-end; align-items: center; min-height: 78px; padding: 20px 6%; }
.privacy, .chat-header p { color: var(--secondary); font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.mobile-brand { display: none; align-items: center; gap: 10px; color: var(--ink); font: 600 20px Rubik, sans-serif; text-decoration: none; }
.mobile-brand span { width: 34px; height: 34px; border-radius: 10px 3px 10px 10px; }

.auth-card { width: min(470px, calc(100% - 40px)); margin: auto; padding: 44px; border: 1px solid rgba(228, 228, 231, .8); border-radius: 24px 8px 24px 24px; background: rgba(255,255,255,.92); box-shadow: 0 24px 70px rgba(24,24,27,.1); backdrop-filter: blur(12px); }
.step h2 { margin: 0; font: 600 36px/1.15 Rubik, sans-serif; letter-spacing: -.03em; }
.step .muted { margin: 14px 0 28px; color: var(--secondary); line-height: 1.55; }
label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #d4d4d8; border-radius: 10px; color: var(--ink); background: var(--white); transition: border-color 180ms ease, box-shadow 180ms ease; }
input { height: 52px; padding: 0 15px; font-size: 16px; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,24,27,.1); outline: none; }
.channel-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 24px; padding: 0; border: 0; }
.channel-option { position: relative; }
.channel-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.channel-option label { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; text-align: center; transition: border-color 180ms ease, background 180ms ease; cursor: pointer; }
.channel-option input:checked + label { border-color: var(--primary); background: var(--muted); }
.channel-option input:focus-visible + label { outline: 3px solid rgba(236,72,153,.28); }
.primary-button { width: 100%; min-height: 52px; margin-top: 16px; padding: 12px 24px; border: 0; border-radius: 10px; color: var(--white); background: var(--accent); font-weight: 700; box-shadow: 0 8px 20px rgba(236,72,153,.22); transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 10px 25px rgba(190,24,93,.25); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.secondary-button { width: 100%; min-height: 46px; margin-top: 10px; padding: 10px 20px; border: 1px solid var(--border); border-radius: 10px; color: var(--primary); background: var(--white); font-weight: 700; transition: border-color 180ms ease, background 180ms ease; }
.secondary-button:hover { border-color: #a1a1aa; background: var(--muted); }
.secondary-button:disabled { cursor: wait; opacity: .6; }
.back-button { display: flex; align-items: center; gap: 5px; margin: -12px 0 24px; padding: 5px 0; border: 0; color: var(--secondary); background: transparent; }
.back-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.code-input { height: 64px; text-align: center; font: 600 28px Rubik, sans-serif; letter-spacing: .35em; }
.error-message { margin: 18px 0 0; padding: 11px 13px; border-radius: 8px; color: var(--danger); background: #fef2f2; font-size: 14px; }
.success-message { margin: 12px 0 0; padding: 11px 13px; border-radius: 8px; color: #166534; background: #f0fdf4; font-size: 14px; }

.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: min(820px, calc(100% - 40px)); height: calc(100vh - 112px); margin: 0 auto 34px; overflow: hidden; border: 1px solid var(--border); border-radius: 22px 8px 22px 22px; background: var(--white); box-shadow: 0 22px 60px rgba(24,24,27,.1); }
.chat-header { display: flex; align-items: center; gap: 13px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.assistant-avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px 4px 13px 13px; }
.chat-header h2 { margin: 0 0 3px; font: 600 16px Rubik, sans-serif; }
.chat-header p { margin: 0; }
.chat-header .status-dot { width: 7px; height: 7px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; border: 0; border-radius: 9px; color: var(--secondary); background: transparent; transition: color 180ms ease, background 180ms ease; }
.icon-button:hover { color: var(--ink); background: var(--muted); }
.icon-button svg, .message-form button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.messages { overflow-y: auto; padding: 28px 24px; scroll-behavior: smooth; }
.message-row { display: flex; margin-bottom: 18px; }
.message-row.user { justify-content: flex-end; }
.bubble { max-width: min(78%, 580px); padding: 12px 15px; border-radius: 4px 16px 16px 16px; color: #27272a; background: var(--muted); line-height: 1.5; white-space: pre-wrap; }
.user .bubble { border-radius: 16px 4px 16px 16px; color: var(--white); background: var(--primary); }
.product-grid { display: grid; gap: 10px; width: min(88%, 620px); margin: -8px 0 20px; }
.product { display: grid; grid-template-columns: 1fr auto; gap: 5px 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); box-shadow: 0 4px 12px rgba(24,24,27,.05); }
.product strong { grid-column: 1; grid-row: 1; font-family: Rubik, sans-serif; }
.product .price { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent-dark); font-weight: 700; }
.product small { grid-column: 1; grid-row: 2; color: var(--secondary); }
.suggestions { display: flex; gap: 8px; overflow-x: auto; padding: 4px 22px 12px; }
.suggestions button { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--secondary); background: var(--white); font-size: 13px; transition: color 180ms ease, border-color 180ms ease; }
.suggestions button:hover { color: var(--ink); border-color: #a1a1aa; }
.message-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--border); }
.message-form textarea { min-height: 48px; max-height: 120px; resize: none; padding: 12px 14px; line-height: 22px; }
.message-form button { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 12px 4px 12px 12px; color: var(--white); background: var(--accent); transition: background 180ms ease; }
.message-form button:hover { background: var(--accent-dark); }
.message-form button:disabled { cursor: wait; opacity: .6; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 850px) {
  .shell { display: block; }
  .brand-panel { display: none; }
  .workspace-header { justify-content: space-between; }
  .mobile-brand { display: flex; }
  .auth-card { margin-top: clamp(30px, 10vh, 100px); }
  .chat { height: calc(100vh - 96px); margin-bottom: 18px; }
}

@media (max-width: 520px) {
  .workspace-header { min-height: 66px; padding: 14px 18px; }
  .privacy { font-size: 12px; }
  .auth-card { width: calc(100% - 28px); margin-top: 30px; padding: 30px 22px; border-radius: 20px 6px 20px 20px; }
  .step h2 { font-size: 30px; }
  .chat { width: 100%; height: calc(100vh - 66px); margin: 0; border-width: 1px 0 0; border-radius: 0; }
  .messages { padding: 22px 15px; }
  .bubble { max-width: 88%; }
  .product-grid { width: 100%; }
  .chat-header { padding: 14px 16px; }
  .suggestions { padding-inline: 15px; }
  .message-form { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
