/* Lookr — identidade derivada da logo: gradiente roxo → azul, cantos suaves. */
:root {
  --violet: #7c3aed;
  --blue: #2563eb;
  --grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7e7ef;
  --bg: #f6f6fb;
  --card: #ffffff;
  --ok: #16a34a;
  --no: #dc2626;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(76, 40, 130, 0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Container mobile-first, centralizado no desktop */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header com a logo */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  background: rgba(246, 246, 251, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.topbar img { height: 34px; }
.topbar .logout {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.screen { flex: 1; padding: 8px 18px 96px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Hero / login */
.hero { text-align: center; padding: 40px 0 20px; }
.hero img { width: 160px; margin-bottom: 8px; }
.hero p { color: var(--muted); margin: 4px 0 0; }

h1, h2 { line-height: 1.2; }
.section-title { font-size: 20px; margin: 18px 0 4px; }
.section-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* Cartões */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

/* Inputs */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
}
input:focus { outline: none; border-color: var(--violet); }

/* Botões */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--violet); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost { background: none; color: var(--muted); box-shadow: none; }
.linkish { background: none; border: none; color: var(--violet); cursor: pointer; font-size: 14px; }

/* Opções do questionário (chips de toque único) */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: border-color .15s, background .15s;
}
.option.selected {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
}

/* Progresso do questionário */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 18px; }
.progress > div { height: 100%; background: var(--grad); transition: width .25s; }

/* Guarda-roupa */
.cat-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.witem {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff;
}
.witem .name { font-size: 14px; }
.witem .meta { font-size: 12px; color: var(--muted); }
/* Toggle "tenho" */
.toggle { width: 52px; height: 30px; border-radius: 99px; background: var(--line); position: relative; border: none; cursor: pointer; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on { background: var(--grad); }
.toggle.on::after { left: 25px; }

/* Ocasião */
.occasions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.occasion { padding: 18px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; text-align: center; cursor: pointer; font-weight: 600; }
.occasion.selected { background: var(--grad); color: #fff; border-color: transparent; }

/* Card do look */
.look-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.look-item:last-child { border-bottom: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); flex: none; }
.look-item .cat { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.justify { background: #f3f0fc; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.tip { font-size: 13px; color: var(--muted); margin-top: 8px; }
.missing { font-size: 13px; color: var(--violet); margin-top: 8px; }

.feedback { display: flex; gap: 12px; margin-top: 16px; }
.fb { flex: 1; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 20px; cursor: pointer; }
.fb.up.active { border-color: var(--ok); background: #ecfdf3; }
.fb.down.active { border-color: var(--no); background: #fef2f2; }

/* Tab bar inferior */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; justify-content: space-around;
  background: #fff; border-top: 1px solid var(--line); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.tab { background: none; border: none; font-size: 11px; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tab .ic { font-size: 20px; }
.tab.active { color: var(--violet); font-weight: 600; }

.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; opacity: 0; transition: opacity .2s; z-index: 50; }
.toast.show { opacity: .95; }

.muted-center { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Adicionar peça por foto / sem foto */
.photo-card { display: flex; flex-direction: column; gap: 10px; }
.photo-card .btn { margin: 0; }
/* Questionário em página única */
.qblock { margin-bottom: 22px; }
.qtitle { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
/* Prévia da ilustração no "adicionar sem foto" */
#m-preview svg { width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 14px; background: #fbfbfe; padding: 4px; }
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: #eee; }
.thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.thumb.illus { background: #fbfbfe; border: 1px solid var(--line); padding: 2px; }
.look-item .thumb { width: 40px; height: 40px; }
.witem .left { display: flex; align-items: center; gap: 12px; }
.remove { border: none; background: none; color: var(--no); font-size: 18px; cursor: pointer; padding: 4px 8px; }

/* Overlay / modal de confirmação editável */
.overlay { position: fixed; inset: 0; background: rgba(20,16,40,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal h3 { margin: 0 0 4px; }
.modal .preview { display: flex; gap: 14px; align-items: center; margin: 8px 0 4px; }
.modal .preview img { width: 88px; height: 88px; border-radius: 14px; object-fit: cover; }
.warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.field label { margin-top: 14px; }
select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; background: #fff; appearance: none; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 11px 0; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; font-size: 15px; cursor: pointer; }
.seg button.on { background: var(--grad); color: #fff; border-color: transparent; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* Admin */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.gear { border: none; background: none; font-size: 20px; cursor: pointer; line-height: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #f7f5fc; border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sub2 { font-size: 13px; font-weight: 600; color: var(--ink); margin: 16px 0 8px; }
.row2 { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.prop { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.prop input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--violet); flex: none; }
.tag-ok { font-size: 11px; background: #ecfdf3; color: var(--ok); padding: 2px 8px; border-radius: 99px; }
.tag-no { font-size: 11px; background: #fef2f2; color: var(--no); padding: 2px 8px; border-radius: 99px; }

/* ---- Refinos v2: cards de tipo, avatar, swatches, ocasiões ---- */
.tech { font-size: 11px; color: var(--muted); font-weight: 400; }

/* Seletor de tipo em cards grandes (legível) */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.typecard { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 6px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.typecard .thumb.illus { width: 62px; height: 62px; border: none; background: transparent; padding: 0; }
.tc-name { font-size: 13px; font-weight: 600; text-align: center; }
.tc-hint { font-size: 11px; color: var(--muted); }
.typecard.sel { border-color: transparent; background: var(--grad); }
.typecard.sel .tc-name { color: #fff; }
.typecard.sel .tc-hint { color: #ffffffcc; }

/* Prévia da peça (manual) maior */
#m-preview svg { width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 14px; background: #fbfbfe; padding: 4px; }

/* Avatar */
.avatar-hero { display: flex; justify-content: center; margin: 6px 0 14px; }
.avatar-hero svg.avatarface { width: 120px; height: 120px; }
.avatar-hero svg.dressed { width: 130px; height: 270px; }

/* ---- Onboarding em passos (stepper ilustrado) ---- */
.step-nav { display: flex; gap: 10px; margin-top: 18px; }
.step-nav .btn { flex: 1; }
.avatar-step { display: flex; justify-content: center; margin: 4px 0 14px; }
.avatar-step svg.dressed { width: 96px; height: 200px; }
/* Botões de opção ilustrados */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.optbtn { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 10px; background: #fff; cursor: pointer; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; color: var(--ink); }
.optbtn.sel { border-color: transparent; background: var(--grad); color: #fff; }
.ob-ic { font-size: 28px; line-height: 1; }
.ob-l { font-size: 14px; font-weight: 600; }
/* Opções com rostinho (pele/cabelo/barba) */
.face-opts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.faceopt { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 4px; background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.faceopt svg.avatarface { width: 60px; height: 60px; }
.faceopt.sel { border-color: transparent; background: var(--grad); }
.fo-l { font-size: 11px; margin-top: 3px; color: var(--ink); }
.faceopt.sel .fo-l { color: #fff; }
/* Paleta como bolinhas */
.palette-opt { flex-direction: row; justify-content: flex-start; gap: 12px; }
.pal-dots { display: inline-flex; gap: 4px; }
.pdot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid #00000022; }
/* Lista de peças adicionadas no fluxo guiado */
.added-list { margin: 12px 0 4px; }
.added-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.added-row { font-size: 14px; color: var(--ok); padding: 2px 0; }

/* ---- Avatar via DiceBear (img) ---- */
img.avatarface { display: block; }
.avatar-hero img.avatarface { width: 160px; height: 160px; }
.avatar-step img.avatarface { width: 120px; height: 120px; }
.avatar-mini img.avatarface { width: 36px; height: 36px; }
.faceopt img.avatarface { width: 64px; height: 64px; border-radius: 8px; }
.avatar-mini { border: none; background: none; padding: 0; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line); }
.avatar-mini svg.avatarface { width: 36px; height: 36px; display: block; }

/* Círculos de cor (pele / cabelo) */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch.sel { border-color: var(--violet); box-shadow: 0 0 0 3px #7c3aed33; }

/* Cards de tipo físico */
.body-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bodycard { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 6px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.bodycard svg.bodyfig { width: 50px; height: 96px; }
.bc-name { font-size: 13px; font-weight: 600; }
.bc-desc { font-size: 11px; color: var(--muted); text-align: center; }
.bodycard.sel { border-color: transparent; background: var(--grad); }
.bodycard.sel .bc-name, .bodycard.sel .bc-desc { color: #fff; }

/* Onboarding: inputs de texto */
.qblock input[type="text"] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }

/* Ocasiões com ícone */
.occasion .oc-ic { display: block; font-size: 22px; margin-bottom: 4px; }

/* Avatar vestido com o look (Fase C) */
.dressed-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.dressed-wrap svg.dressed { width: 130px; height: auto; }
