/* The Bubento Site Builder: sign-up, "My websites" and the quiz. Same palette as the editing page. */

:root {
  --ink: #1d2621;
  --muted: #5d6862;
  --faint: #8a938e;
  --line: #e4e1d9;
  --paper: #f7f5f0;
  --card: #ffffff;
  --accent: #274e3f;
  --accent-hover: #1f3f33;
  --accent-soft: #e7efea;
  --danger: #a3361f;
  --ok: #2f7a4f;
  --warn: #8a5a12;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 8px 24px rgba(20, 30, 25, 0.08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.55 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
.muted { color: var(--muted); }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 32px); background: var(--card); border-bottom: 1px solid var(--line); }
.top__brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; min-width: 0; }
.top__brand img { border-radius: 7px; flex: none; }
.top__brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top__place { color: var(--muted); font-size: 14px; }
.top__lang { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.top__lang:hover { background: var(--accent-soft); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f1efe9; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); min-height: 36px; padding: 0 10px; font-size: 14px; }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--wide { width: 100%; min-height: 48px; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 8px 0; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { font-weight: 600; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input:not([type]), textarea, select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d6d2c8; border-radius: 9px; background: #fff; font-size: 16px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; font-weight: 400; }
.hint a { color: var(--accent); text-underline-offset: 2px; }
.form-msg { min-height: 1.5em; margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.form-msg.is-error { color: var(--danger); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); }

/* Page */
.page { max-width: 1040px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 32px) 64px; }

/* Landing */
.landing { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
.landing h1 { font-size: clamp(30px, 5vw, 46px); }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.how__title { font-size: 17px; margin: 0 0 10px; }
.how { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--muted); }
.signup label { display: block; margin-bottom: 8px; }
.signup input { margin-bottom: 12px; }
#code { font-size: 24px; letter-spacing: 4px; }

/* My websites */
.sites__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sites__head h1 { margin: 0; }
.site-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.site { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.site__main { min-width: 0; flex: 1 1 280px; }
.site__name { font-size: 18px; font-weight: 650; margin: 0 0 6px; overflow-wrap: anywhere; }
.site__meta { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.site__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #efece5; color: var(--muted); }
.badge--ok { background: var(--accent-soft); color: var(--accent); }
.badge--wait { background: #fbf1df; color: var(--warn); }
.badge--bad { background: #f8e4de; color: var(--danger); }
.meter { height: 6px; border-radius: 3px; background: #efece5; overflow: hidden; margin-top: 8px; max-width: 220px; }
.meter span { display: block; height: 100%; background: var(--accent); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Quiz */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz__step { margin: 0 0 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.progress { height: 6px; border-radius: 3px; background: #e9e5dc; overflow: hidden; margin: 0 0 22px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease; }
.quiz__form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field > label, .field > .field__label { display: block; font-weight: 600; }
.field.is-error input, .field.is-error textarea, .field.is-error select { border-color: var(--danger); }
.row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.row--3 { grid-template-columns: 2fr 1fr 1.4fr; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #d6d2c8; background: #fff; font-weight: 550; font-size: 15px; cursor: pointer; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; border: 1px solid #d6d2c8; border-radius: 9px; background: #fff; font-weight: 500; cursor: pointer; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
.looks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.look { position: relative; border: 2px solid transparent; border-radius: 12px; cursor: pointer; display: block; }
.look input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.look__card { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.look__top { display: block; padding: 14px 14px 10px; }
.look__aa { display: block; font-size: 26px; line-height: 1; margin-bottom: 10px; }
.look__line { display: block; height: 6px; border-radius: 3px; width: 70%; margin-bottom: 6px; opacity: 0.35; }
.look__btn { display: inline-block; height: 14px; width: 54px; border-radius: 4px; margin-top: 4px; }
.look__strip { display: flex; height: 16px; }
.look__strip i { flex: 1; }
.look__name { display: block; padding: 8px 2px 0; font-weight: 600; font-size: 14.5px; text-align: center; }
.look:has(input:checked) { border-color: var(--accent); }
.look:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pairs { display: grid; gap: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid #d6d2c8; background: #fff; font-weight: 550; font-size: 14.5px; cursor: pointer; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.uploads { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { position: relative; width: 104px; height: 104px; border-radius: 10px; overflow: hidden; background: #efece5; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile--logo img { object-fit: contain; background: #fff; padding: 8px; }
.tile__remove { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(29, 38, 33, 0.8); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.tile--add { cursor: pointer; border-style: dashed; border-color: #c9c4b8; background: #fff; font-weight: 600; color: var(--accent); padding: 8px; }
.tile.is-error { color: var(--danger); padding: 8px; }
.summary { display: grid; gap: 10px; margin: 0; }
.summary div { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.summary dt { font-weight: 600; color: var(--muted); font-size: 14.5px; }
.summary dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 550; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.quiz__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.quiz__saved { color: var(--faint); font-size: 13.5px; }

/* Building */
.done { max-width: 620px; margin: 0 auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.done .spinner { width: 28px; height: 28px; color: var(--accent); }
.done p { color: var(--muted); margin: 0 0 8px; }

@media (max-width: 760px) {
  .landing { grid-template-columns: 1fr; }
  .row, .row--3 { grid-template-columns: 1fr; }
  .looks { grid-template-columns: repeat(2, 1fr); }
  .summary div { grid-template-columns: 1fr; gap: 2px; }
  .top__place { display: none; }
  .top__brand span { display: none; }
  .top__nav { flex-wrap: nowrap; gap: 2px; }
  .top { padding: 10px 14px; }
  .quiz__nav .btn { flex: 1; }
  .quiz__saved { display: none; }
}

/* The AI's follow-up questions (step 6). */
.followups { display: grid; gap: 18px; }
.followups__wait { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.followups__wait .spinner { color: var(--accent); }
.followup input[type="text"] { margin-top: 8px; }
.hint--above { margin: -2px 0 8px; }
.uploads { border-radius: 12px; transition: background-color .15s, box-shadow .15s; }
.uploads.is-over { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.tile--add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tile__or { font-size: 11px; font-weight: 500; color: var(--muted); }
@media (hover: none) { .tile__or { display: none; } }
.done.is-ready .spinner, .done.is-failed .spinner { display: none; }
.progress-box { width: 100%; max-width: 420px; margin: 4px 0 12px; text-align: left; display: grid; gap: 12px; }
.progress-box[hidden] { display: none; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stage { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; }
.stage__dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d6d2c8; flex: none; display: grid; place-items: center; }
.stage.is-now { color: var(--ink, #1c2520); font-weight: 650; }
.stage.is-now .stage__dot { border-color: var(--accent); background: var(--accent-soft); animation: stage-pulse 1.6s ease-in-out infinite; }
.stage.is-done .stage__dot { border-color: var(--accent); background: var(--accent); }
.stage.is-done .stage__dot::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
@keyframes stage-pulse { 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .stage.is-now .stage__dot { animation: none; } }
.done-steps { list-style: none; margin: 0 0 0 28px; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.done-steps:empty { display: none; }
.done-steps li { display: flex; gap: 8px; }
.done-steps li:last-child { color: var(--ink, #1c2520); }
.done-steps__count { font-variant-numeric: tabular-nums; opacity: .7; }
.done .done-time { font-size: 13px; margin: 0; }
.site__hint { font-size: 13px; }
.site__hint.is-low { color: var(--danger); }
.meter--low span { background: var(--danger); }
.site__progress { display: grid; gap: 2px; margin-top: 10px; }
.site__progress p { margin: 0; }
.site__stage { font-weight: 600; color: var(--ink); font-size: 15px; }
.site__now { color: var(--muted); font-size: 14px; }
.btn--quiet { color: var(--danger); border-color: transparent; background: transparent; box-shadow: none; }
.btn--quiet:hover { background: #f6e9e5; }
