/* =================================================================
   Plataforma — site do produto, login e editor.
   Claro e quente (Off-white + Caramelo), independente do tema de cada página.
   ================================================================= */
:root {
  --a-bg: #fbf5ee;
  --a-bg-2: #f3e8db;
  --a-card: #ffffff;
  --a-ink: #22140b;
  --a-ink-2: rgba(34, 20, 11, 0.68);
  --a-ink-3: rgba(34, 20, 11, 0.45);
  --a-line: rgba(66, 28, 11, 0.14);
  --a-accent: #964b22;
  --a-accent-2: #c77440;
  --a-accent-soft: rgba(199, 116, 64, 0.12);
  --a-dark: #2a1309;
  --a-ok: #1f7a47;
  --a-warn: #a0361a;
  --a-radius: 16px;
  --a-shadow: 0 18px 40px -24px rgba(66, 28, 11, 0.45);
  --f-display: "Fraunces", Georgia, serif;
  --f-ui: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--a-bg); color: var(--a-ink); font: 400 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--a-accent-2); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }

/* ---------- Botões ---------- */
.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--a-line); background: var(--a-card); cursor: pointer;
  font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap;
  transition: transform .25s, background-color .25s, border-color .25s, box-shadow .25s;
}
.a-btn:hover { border-color: rgba(66, 28, 11, 0.32); }
.a-btn:active { transform: scale(.97); }
.a-btn--primary { color: #fff; background: linear-gradient(180deg, var(--a-accent-2), var(--a-accent)); border-color: transparent; box-shadow: 0 10px 24px -12px rgba(150, 75, 34, .8); }
.a-btn--primary:hover { box-shadow: 0 14px 30px -12px rgba(150, 75, 34, .9); transform: translateY(-1px); }
.a-btn--dark { color: #fbefe5; background: var(--a-dark); border-color: transparent; }
.a-btn--ghost { background: transparent; }
.a-btn--sm { min-height: 36px; padding: 0 14px; font-size: .8125rem; }
.a-btn--block { width: 100%; }
.a-btn[disabled] { opacity: .55; cursor: default; transform: none; }

/* ---------- Campos ---------- */
.a-field { display: grid; gap: 6px; min-width: 0; }
.a-field > span { font-size: .8125rem; font-weight: 600; }
.a-input, .a-field input:not([type=checkbox]):not([type=range]):not([type=color]):not([type=file]), .a-field select, .a-field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--a-line); background: #fff; font-size: 1rem;
}
.a-field textarea { resize: vertical; }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus, .a-input:focus { outline: 2px solid var(--a-accent-2); outline-offset: 0; border-color: transparent; }
.a-hint { font-size: .75rem; color: var(--a-ink-2); }
.a-hint.is-ok { color: var(--a-ok); }
.a-hint.is-bad { color: var(--a-warn); }
.a-prefix { display: flex; align-items: center; border: 1px solid var(--a-line); border-radius: 12px; background: #fff; overflow: hidden; }
.a-prefix span { padding: 0 4px 0 14px; color: var(--a-ink-3); white-space: nowrap; font-size: .9375rem; }
.a-prefix input { border: 0 !important; padding-left: 2px !important; min-width: 0; }
.a-prefix:focus-within { outline: 2px solid var(--a-accent-2); border-color: transparent; }

/* ---------- Marca do produto ---------- */
.p-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; font-size: 1.0625rem; }
.p-logo__icon { width: 32px; height: 32px; display: block; flex: none; }
.p-logo__word { height: 17px; width: auto; display: block; }

/* ---------- Mensagens ---------- */
.a-toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 500; transform: translate(-50%, 16px);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: var(--a-dark); color: #fbefe5; font-size: .875rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: 0 18px 40px -16px rgba(0,0,0,.5);
}
.a-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.a-toast.is-ok { background: var(--a-ok); }
.a-toast.is-warn { background: var(--a-warn); }
.demo-flag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #fff3d9; color: #6b4a0d; border: 1px solid #ecd6a6; }

/* =================================================================
   Login / cadastro
   ================================================================= */
.auth { min-height: 100svh; display: grid; }
.auth__art {
  display: none; position: relative; overflow: hidden; color: #fbefe5; padding: 48px;
  background: radial-gradient(70% 60% at 70% 20%, rgba(199,116,64,.55), transparent 70%), linear-gradient(160deg, #6a2e13, #1f0e07);
}
.auth__art h2 { font-family: var(--f-display); font-weight: 300; font-size: 3rem; line-height: 1.02; letter-spacing: -.02em; margin: 0; max-width: 12ch; }
.auth__art p { color: rgba(251,239,229,.75); max-width: 36ch; }
.auth__main { display: grid; align-content: center; justify-items: center; padding: 32px 16px calc(32px + env(safe-area-inset-bottom, 0px)); }
.auth__card { width: 100%; max-width: 420px; display: grid; gap: 18px; }
.auth__card h1 { font-family: var(--f-display); font-weight: 400; font-size: 2rem; letter-spacing: -.02em; margin: 0; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--a-bg-2); }
.auth__tabs button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; color: var(--a-ink-2); }
.auth__tabs button[aria-selected="true"] { background: #fff; color: var(--a-ink); box-shadow: 0 4px 12px -6px rgba(66,28,11,.4); }
.auth__form { display: grid; gap: 14px; }
.auth__msg { padding: 12px 14px; border-radius: 12px; font-size: .875rem; background: var(--a-accent-soft); }
.auth__msg.is-bad { background: #fde8e2; color: var(--a-warn); }
.auth__msg.is-ok { background: #e3f6ea; color: var(--a-ok); }
.auth__link { background: none; border: 0; padding: 0; color: var(--a-accent); font-weight: 600; cursor: pointer; justify-self: start; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth__art { display: flex; flex-direction: column; justify-content: space-between; }
}

/* =================================================================
   Editor
   ================================================================= */
.ed { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.ed__top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-left, 0px));
  padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: rgba(251,245,238,.9); border-bottom: 1px solid var(--a-line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.ed__url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.ed__url a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; color: var(--a-ink-2); text-decoration: none; }
.ed__url a:hover { color: var(--a-ink); text-decoration: underline; }
.ed__status { flex: none; font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--a-bg-2); color: var(--a-ink-2); border: 0; cursor: pointer; font-family: inherit; }
.ed__status.is-live { background: #e3f6ea; color: var(--a-ok); }
.ed__status.is-wait { background: #fff3d9; color: #6b4a0d; }
.ed__save { font-size: .75rem; color: var(--a-ink-3); white-space: nowrap; }
.ed__body { display: grid; min-height: 0; }
.ed__panel { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.ed__tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid var(--a-line); scrollbar-width: none; background: var(--a-bg); position: sticky; top: 61px; z-index: 40; }
.ed__tabs::-webkit-scrollbar { display: none; }
.ed__tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--a-line); background: #fff; font-weight: 600; font-size: .8125rem; color: var(--a-ink-2); cursor: pointer; }
.ed__tabs button[aria-selected="true"] { background: var(--a-dark); color: #fbefe5; border-color: var(--a-dark); }
.ed__tabs svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed__form { padding: 16px 16px calc(110px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; align-content: start; }
.ed__preview-btn { position: fixed; z-index: 60; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 16px 34px -14px rgba(0,0,0,.6); }

.ed__stage { display: none; }
.ed__stage.is-open { /* celular: prévia em tela cheia */
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 80; background: rgba(34,20,11,.82); padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}
.phone { position: relative; width: min(390px, 100%); height: min(800px, calc(100svh - 120px)); border-radius: 44px; padding: 12px; background: #120a05; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), inset 0 0 0 2px #3a2a20; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 34px; background: #000; }
.phone__notch { position: absolute; top: 20px; left: 50%; width: 92px; height: 24px; margin-left: -46px; border-radius: 20px; background: #120a05; z-index: 2; }
.ed__stage-close { margin-top: 14px; }
@media (min-width: 1000px) {
  .ed__body { grid-template-columns: minmax(420px, 520px) 1fr; }
  .ed__panel { border-right: 1px solid var(--a-line); height: calc(100svh - 61px); }
  .ed__form { overflow-y: auto; padding-bottom: 60px; }
  .ed__tabs { position: static; }
  .ed__stage, .ed__stage.is-open { display: grid; place-items: center; position: sticky; top: 61px; height: calc(100svh - 61px); background: radial-gradient(60% 60% at 50% 40%, var(--a-bg-2), var(--a-bg)); padding: 24px; inset: auto; z-index: auto; }
  .ed__preview-btn, .ed__stage-close { display: none; }
}

/* seções e cartões do editor */
.sec { display: grid; gap: 14px; padding: 16px; border-radius: var(--a-radius); background: var(--a-card); border: 1px solid var(--a-line); }
.sec > h3 { margin: 0; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--a-accent); }
.sec > p.a-hint { margin: -6px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toggle { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: .9375rem; }
.toggle input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: rgba(66,28,11,.2); position: relative; cursor: pointer; flex: none; transition: background-color .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.toggle input:checked { background: var(--a-ok); }
.toggle input:checked::after { transform: translateX(18px); }

/* paletas */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.theme-chip { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: 14px; border: 2px solid transparent; background: var(--a-bg); cursor: pointer; text-align: left; font-size: .75rem; font-weight: 600; }
.theme-chip[aria-pressed="true"] { border-color: var(--a-accent-2); background: #fff; }
.theme-chip__sw { height: 56px; border-radius: 10px; position: relative; overflow: hidden; }
.theme-chip__sw::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 9px; height: 12px; border-radius: 6px; background: var(--acc); }
.theme-chip__sw::before { content: "Aa"; position: absolute; left: 10px; top: 6px; font-family: var(--f-display); font-size: 1rem; color: var(--txt); }
.colors { display: grid; gap: 8px; }
.color { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.color input[type=color] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--a-line); border-radius: 12px; background: none; cursor: pointer; }
.color input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.color input[type=color]::-webkit-color-swatch { border: 0; border-radius: 9px; }
.color b { font-size: .875rem; }
.color small { display: block; color: var(--a-ink-2); font-size: .75rem; }
.color code { font-size: .75rem; color: var(--a-ink-3); }
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.font-chip { min-height: 54px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--a-line); background: #fff; cursor: pointer; font-size: 1.25rem; text-align: left; }
.font-chip[aria-pressed="true"] { border-color: var(--a-accent-2); }

/* imagens */
.img-field { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; }
.img-field__thumb { width: 92px; height: 92px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: repeating-conic-gradient(#f0e6da 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--a-line); }
.img-field__thumb img, .img-field__thumb video { width: 100%; height: 100%; object-fit: cover; }
.img-field__thumb em { font-size: .75rem; color: var(--a-ink-3); font-style: normal; text-align: center; padding: 4px; }
.img-field__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.size-chip { justify-self: start; font-size: .75rem; padding: 4px 10px; border-radius: 8px; background: var(--a-accent-soft); color: #6a2e13; }
.upload-bar { height: 4px; border-radius: 4px; background: var(--a-bg-2); overflow: hidden; }
.upload-bar i { display: block; height: 100%; width: 30%; background: var(--a-accent-2); animation: upl 1.1s ease-in-out infinite; }
@keyframes upl { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* listas */
.list { display: grid; gap: 8px; }
.item { border-radius: 14px; border: 1px solid var(--a-line); background: #fff; }
.item > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; min-height: 56px; cursor: pointer; }
.item > summary::-webkit-details-marker { display: none; }
.item[open] > summary { border-bottom: 1px solid var(--a-line); }
.item__thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--a-bg-2); }
.item__num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--a-bg); font-size: .8125rem; font-weight: 700; flex: none; }
.item__title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__acts { display: flex; flex: none; }
.item__acts button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--a-ink-2); font-size: .9rem; }
.item__acts button:hover:not(:disabled) { background: var(--a-bg); color: var(--a-ink); }
.item__acts button:disabled { opacity: .3; cursor: default; }
.item__body { display: grid; gap: 12px; padding: 14px 12px; }
.chip { flex: none; font-size: .6875rem; padding: 2px 8px; border-radius: 999px; background: var(--a-bg-2); color: var(--a-ink-2); }
.add { width: 100%; border-style: dashed; background: transparent; }

.range { display: grid; grid-template-columns: 40px 1fr 40px; gap: 8px; align-items: center; }
.range input { accent-color: var(--a-accent); }
.range button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--a-line); background: #fff; cursor: pointer; font-size: 1.1rem; }

/* diálogo */
.dlg { position: fixed; inset: 0; z-index: 400; display: grid; place-items: end center; padding: 16px; background: rgba(34,20,11,.45); }
.dlg__box { width: 100%; max-width: 460px; max-height: 84vh; overflow: auto; display: grid; gap: 14px; padding: 20px; border-radius: 20px; background: var(--a-bg); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.dlg__box h3 { margin: 0; font-size: 1.0625rem; }
.dlg__box p { margin: 0; color: var(--a-ink-2); }
@media (min-width: 700px) { .dlg { place-items: center; } }

/* boas-vindas (escolher endereço) */
.onboard { min-height: calc(100svh - 61px); display: grid; place-items: center; padding: 24px 16px; }
.onboard__card { width: 100%; max-width: 460px; display: grid; gap: 16px; padding: 24px; border-radius: 24px; background: #fff; border: 1px solid var(--a-line); box-shadow: var(--a-shadow); }
.onboard__card h1 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.75rem; letter-spacing: -.02em; }
