/* ============================================================
   Redadito — design system
   Estética editorial minimalista · luz quente · acento "Redadito red"
   ============================================================ */

:root {
  /* superfícies */
  --bg:        #FAFAF7;
  --bg-tint:   #F3F1EA;
  --surface:   #FFFFFF;
  --surface-2: #FBFAF7;

  /* tinta */
  --ink:    #17140F;
  --ink-2:  #3A352E;
  --muted:  #76706722;
  --muted-fg: #837C72;
  --line:   #E8E3D9;
  --line-2: #DED8CC;

  /* acento */
  --accent:      #D6203A;
  --accent-ink:  #AE1530;
  --accent-soft: #FBE7EA;
  --accent-glow: rgba(214, 32, 58, 0.18);

  /* tipografia */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* forma */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* sombra */
  --shadow-sm: 0 1px 2px rgba(24, 20, 15, 0.04), 0 2px 8px rgba(24, 20, 15, 0.04);
  --shadow-md: 0 4px 14px rgba(24, 20, 15, 0.06), 0 18px 40px -18px rgba(24, 20, 15, 0.18);
  --shadow-lg: 0 10px 30px rgba(24, 20, 15, 0.08), 0 40px 80px -30px rgba(24, 20, 15, 0.22);
  --shadow-focus: 0 0 0 4px var(--accent-glow);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

/* ---------- ambiência ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.blob--1 { width: 46vw; height: 46vw; top: -16vw; left: -10vw;
  background: radial-gradient(circle at 30% 30%, #FBE0E5, transparent 70%);
  animation: drift1 26s var(--ease) infinite alternate; }
.blob--2 { width: 40vw; height: 40vw; bottom: -14vw; right: -8vw;
  background: radial-gradient(circle at 60% 40%, #FDEFD8, transparent 70%);
  animation: drift2 32s var(--ease) infinite alternate; }
.blob--3 { width: 30vw; height: 30vw; top: 30%; left: 55%;
  background: radial-gradient(circle at 50% 50%, #E7ECFB, transparent 70%);
  animation: drift3 38s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate3d(6vw, 5vw, 0) scale(1.1); } }
@keyframes drift2 { to { transform: translate3d(-5vw, -4vw, 0) scale(1.15); } }
@keyframes drift3 { to { transform: translate3d(-7vw, 4vw, 0) scale(0.9); } }

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(18px, 5vw, 48px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand__mark { display: grid; place-items: center; }
.brand__mark .wave rect { fill: var(--accent); transform-origin: center; }
.brand__mark .wave rect:nth-child(1) { animation: bar 1.9s var(--ease) infinite; }
.brand__mark .wave rect:nth-child(2) { animation: bar 1.9s var(--ease) infinite 0.15s; }
.brand__mark .wave rect:nth-child(3) { animation: bar 1.9s var(--ease) infinite 0.30s; }
.brand__mark .wave rect:nth-child(4) { animation: bar 1.9s var(--ease) infinite 0.45s; }
.brand__mark .wave rect:nth-child(5) { animation: bar 1.9s var(--ease) infinite 0.60s; }
@keyframes bar { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.55); } }
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -0.02em; }

.topnav { display: flex; align-items: center; gap: 22px; }
.topnav__link {
  font-size: 14.5px; font-weight: 500; color: var(--muted-fg);
  text-decoration: none; transition: color 0.2s;
}
.topnav__link:hover { color: var(--ink); }
.mode-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 4px 9px; border-radius: 999px; border: 1px solid #F4CBD2;
}

/* ---------- conta (topbar) ---------- */
.account { display: flex; align-items: center; gap: 10px; }
.account__btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: #fff;
  background: var(--accent); border: none; padding: 9px 16px; border-radius: 11px; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s;
}
.account__btn:hover { transform: translateY(-1px); background: var(--accent-ink); }
.account__chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 6px 5px 12px; font-size: 13px; color: var(--ink-2);
}
.account__plan { font-weight: 600; }
.account__credits { color: var(--muted-fg); }
.account__credits b { color: var(--accent-ink); font-weight: 700; }
.account__sep { width: 1px; height: 16px; background: var(--line-2); }
.account__out {
  border: none; background: var(--bg-tint); color: var(--muted-fg); cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  transition: background 0.2s, color 0.2s;
}
.account__out:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(24, 20, 15, 0.42); backdrop-filter: blur(3px); animation: fade 0.25s ease both; }
.modal__card {
  position: relative; width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 30px 28px 26px;
  animation: pop 0.32s var(--ease-out) both;
}
.modal__close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--bg-tint); color: var(--muted-fg); font-size: 19px; cursor: pointer;
  display: grid; place-items: center; transition: background 0.2s, color 0.2s;
}
.modal__close:hover { background: var(--accent-soft); color: var(--accent-ink); }
.modal__brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-bottom: 20px; }
.modal__brand .brand__mark { margin-bottom: 4px; }
.modal__title { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); }
.modal__sub { font-size: 13.5px; color: var(--muted-fg); max-width: 280px; }

.auth-tabs { display: flex; gap: 4px; background: var(--bg-tint); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; border: none; background: none; cursor: pointer; padding: 9px; border-radius: 9px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted-fg); transition: all 0.2s;
}
.auth-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-input {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); background: var(--surface); }
.auth-submit {
  margin-top: 4px; font-family: var(--sans); font-size: 15.5px; font-weight: 600; color: #fff;
  background: var(--accent); border: none; padding: 13px; border-radius: 12px; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); background: var(--accent-ink); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-msg { margin: 6px 2px 0; font-size: 13px; text-align: center; }
.auth-msg.is-error { color: var(--accent-ink); }
.auth-msg.is-ok { color: #157347; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- stage ---------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(20px, 5vh, 56px) clamp(18px, 5vw, 24px) 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* ---------- hero ---------- */
.hero { text-align: center; animation: enter 0.7s var(--ease-out) both; }
.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(54px, 11vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: clamp(8px, 4vh, 30px) 0 0;
  background: linear-gradient(180deg, var(--ink), #46403a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tagline {
  font-size: clamp(16px, 2.6vw, 20px);
  color: var(--ink-2);
  margin: 14px 0 clamp(24px, 5vh, 40px);
  letter-spacing: -0.015em;
}
.hero__accent { color: var(--accent); font-weight: 500; }

/* ---------- composer ---------- */
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  text-align: left;
  animation: enter 0.7s var(--ease-out) 0.08s both;
}

.field { position: relative; }

.field--source {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 6px 6px 6px 16px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field--source.is-focused { border-color: var(--accent); box-shadow: var(--shadow-focus); background: var(--surface); }
.field--source.is-drag { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }
.field__icon { color: var(--muted-fg); display: grid; place-items: center; flex: none; }
.field--source.is-focused .field__icon { color: var(--accent); }
.field__input {
  flex: 1; min-width: 0;
  border: none; background: none; outline: none;
  font-family: var(--sans); font-size: 16px; color: var(--ink); padding: 12px 0;
}
.field__input::placeholder { color: var(--muted-fg); }
.field__upload {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2);
  padding: 9px 13px; border-radius: 14px; cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.2s, color 0.2s, background 0.2s;
}
.field__upload:hover { color: var(--accent-ink); border-color: #EBC7CE; background: var(--accent-soft); transform: translateY(-1px); }
.field__upload:active { transform: translateY(0); }

/* source chip */
.source-chip {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 12px 4px 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 7px 7px 7px 12px; border-radius: 999px;
  animation: pop 0.35s var(--ease-out) both;
}
.source-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.source-chip__clear {
  border: none; background: var(--bg-tint); color: var(--muted-fg);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1;
  display: grid; place-items: center; transition: background 0.2s, color 0.2s;
}
.source-chip__clear:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* instruction */
.field--instruction { margin-top: 12px; padding: 4px 14px 2px; }
.field__textarea {
  width: 100%; border: none; background: none; outline: none; resize: none;
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink);
  padding: 10px 0; max-height: 200px;
}
.field__ghost {
  position: absolute; top: 14px; left: 14px; right: 14px;
  font-size: 16px; line-height: 1.5; color: var(--muted-fg);
  pointer-events: none; white-space: nowrap; overflow: hidden;
}
.field__ghost::after { content: "▎"; color: var(--accent); animation: caret 1.1s step-end infinite; margin-left: 1px; }
.field--instruction.has-text .field__ghost { display: none; }

/* ---------- formatos ---------- */
.formats {
  display: flex; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
  padding: 14px 4px 4px;
  margin-top: 4px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.formats::-webkit-scrollbar { display: none; }
.fmt {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1.5px solid var(--line);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s var(--ease), border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}
.fmt:hover { transform: translateY(-2px); border-color: var(--line-2); }
.fmt__icon { color: var(--muted-fg); display: grid; place-items: center; transition: color 0.2s; }
.fmt.is-active {
  color: #fff; background: var(--accent); border-color: var(--accent);
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}
.fmt.is-active .fmt__icon { color: #fff; }

/* ---------- ações ---------- */
.composer__actions {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 6px 4px; margin-top: 4px;
  border-top: 1px solid var(--line);
}
.composer__hint { margin: 0; font-size: 13px; color: var(--muted-fg); }
.btn-process {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 15.5px; font-weight: 600; color: #fff;
  background: var(--accent); border: none;
  padding: 13px 22px; border-radius: 14px; cursor: pointer;
  box-shadow: 0 8px 20px -8px var(--accent-glow);
  transition: transform 0.16s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
}
.btn-process:hover:not(:disabled) { transform: translateY(-2px); background: var(--accent-ink); box-shadow: 0 12px 26px -8px var(--accent-glow); }
.btn-process:active:not(:disabled) { transform: translateY(0); }
.btn-process:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-process__arrow { transition: transform 0.2s var(--ease); }
.btn-process:hover:not(:disabled) .btn-process__arrow { transform: translateX(3px); }
.btn-process__spinner {
  display: none; width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-process.is-loading .btn-process__arrow { display: none; }
.btn-process.is-loading .btn-process__spinner { display: inline-block; }

/* ---------- fontes ---------- */
.sources {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
  padding: 0; margin: clamp(22px, 5vh, 34px) auto 0; max-width: 600px;
  animation: enter 0.7s var(--ease-out) 0.16s both;
}
.sources li {
  font-size: 12.5px; font-weight: 500; color: var(--muted-fg);
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.5);
}

/* ---------- processamento ---------- */
.processing {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(26px, 5vw, 40px);
  animation: enter 0.5s var(--ease-out) both;
}
.pipeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-step { display: flex; align-items: center; gap: 14px; padding: 10px 4px; position: relative; opacity: 0.4; transition: opacity 0.4s; }
.pl-step::before {
  content: ""; position: absolute; left: 12px; top: 34px; bottom: -4px; width: 2px;
  background: var(--line); transform: scaleY(0); transform-origin: top; transition: transform 0.4s var(--ease);
}
.pl-step:last-child::before { display: none; }
.pl-step.is-done::before { transform: scaleY(1); background: var(--accent); }
.pl-step__dot {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-2); background: var(--surface);
  display: grid; place-items: center; transition: all 0.3s var(--ease);
}
.pl-step__text { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.pl-step.is-active { opacity: 1; }
.pl-step.is-active .pl-step__dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.pl-step.is-active .pl-step__dot::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.2s var(--ease) infinite;
}
.pl-step.is-done { opacity: 1; }
.pl-step.is-done .pl-step__dot { border-color: var(--accent); background: var(--accent); }
.pl-step.is-done .pl-step__dot::after {
  content: ""; width: 11px; height: 7px; border: 2.4px solid #fff; border-top: none; border-right: none;
  transform: rotate(-45deg) translateY(-1px); border-radius: 1px;
}

.progress { height: 5px; background: var(--bg-tint); border-radius: 999px; overflow: hidden; margin: 22px 0 14px; }
.progress__bar {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #F0506A);
  border-radius: 999px; transition: width 0.4s var(--ease);
}
.progress.is-indeterminate .progress__bar {
  width: 35% !important;
  animation: indeterminate 1.3s var(--ease) infinite;
}
.processing__note { margin: 0; font-size: 14px; color: var(--muted-fg); text-align: center; }

/* ---------- resultado ---------- */
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: enter 0.5s var(--ease-out) both;
}
.result__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px clamp(18px, 4vw, 26px);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.result__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted-fg); }
.result__meta .pill {
  font-weight: 600; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
}
.result__meta .pill--accent { color: var(--accent-ink); background: var(--accent-soft); border-color: #F4CBD2; }
.result__tools { display: flex; gap: 7px; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2);
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.2s, color 0.2s, background 0.2s;
}
.tool:hover { transform: translateY(-1px); color: var(--accent-ink); border-color: #EBC7CE; background: var(--accent-soft); }
.tool--ghost { color: var(--muted-fg); }
.tool.is-ok { color: #157347; border-color: #BCE3C9; background: #E9F7EE; }

/* conversa (thread) */
.thread {
  padding: clamp(18px, 4vw, 28px) clamp(16px, 4vw, 32px);
  max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.msg { animation: enter 0.4s var(--ease-out) both; max-width: 100%; }
.msg--user {
  align-self: flex-end; background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid #F4CBD2; border-radius: 16px 16px 4px 16px;
  padding: 10px 15px; font-size: 14.5px; font-weight: 500; max-width: 80%;
}
.msg--bot { align-self: stretch; }
.msg__role {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted-fg); margin-bottom: 8px;
}
.msg__role .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.msg__body { font-size: 16.5px; line-height: 1.7; color: var(--ink-2); }
.msg__body.is-streaming::after {
  content: "▎"; color: var(--accent); animation: caret 1.1s step-end infinite; margin-left: 1px;
}
.msg__body h1, .msg__body h2, .msg__body h3 {
  font-family: var(--serif); color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; margin: 1.4em 0 0.5em;
}
.msg__body h1 { font-size: 1.55em; } .msg__body h2 { font-size: 1.3em; } .msg__body h3 { font-size: 1.1em; }
.msg__body > :first-child { margin-top: 0; }
.msg__body p { margin: 0 0 0.9em; }
.msg__body strong { color: var(--ink); font-weight: 650; }
.msg__body em { color: var(--muted-fg); }
.msg__body ul, .msg__body ol { margin: 0 0 1em; padding-left: 1.3em; }
.msg__body li { margin-bottom: 0.4em; }
.msg__body ul li::marker { color: var(--accent); }
.msg__body blockquote {
  border-left: 3px solid var(--accent); margin: 1em 0; padding: 0.2em 0 0.2em 1em; color: var(--muted-fg); font-style: italic;
}

/* sugestão de planos dentro da conversa */
.msg__suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.msg__suggest button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: #fff; background: var(--accent);
  border: none; padding: 9px 15px; border-radius: 10px; cursor: pointer; transition: transform .15s var(--ease), background .2s;
}
.msg__suggest button:hover { transform: translateY(-1px); background: var(--accent-ink); }
.msg__suggest button.ghost { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); }

/* barra de refino */
.refine {
  display: flex; align-items: center; gap: 8px;
  padding: 12px clamp(14px, 4vw, 22px); border-top: 1px solid var(--line); background: var(--surface-2);
}
.refine__input {
  flex: 1; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 12px 15px; font-family: var(--sans); font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.refine__input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.refine__btn {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  transition: transform .15s var(--ease), background .2s, opacity .2s;
}
.refine__btn:hover:not(:disabled) { transform: translateY(-1px); background: var(--accent-ink); }
.refine__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- planos ---------- */
.plans { margin-top: clamp(40px, 8vh, 72px); text-align: center; animation: enter 0.6s var(--ease-out) both; }
.plans__title { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.plans__sub { color: var(--muted-fg); margin: 10px 0 28px; font-size: 15px; }
.plans__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left; }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 20px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.plan--highlight { border-color: var(--accent); box-shadow: 0 10px 30px -12px var(--accent-glow); }
.plan__badge { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--accent); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.plan__name { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); }
.plan__tagline { font-size: 12.5px; color: var(--muted-fg); margin: 2px 0 14px; }
.plan__price { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.plan__price small { font-size: 14px; font-weight: 500; color: var(--muted-fg); }
.plan__price .free { font-family: var(--serif); }
.plan__features { list-style: none; padding: 0; margin: 16px 0 20px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.plan__features li { display: flex; gap: 8px; align-items: flex-start; }
.plan__features li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D6203A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; }
.plan__cta {
  margin-top: auto; font-family: var(--sans); font-size: 14.5px; font-weight: 600; cursor: pointer;
  padding: 12px; border-radius: 12px; border: 1px solid var(--accent); color: var(--accent); background: var(--surface);
  transition: transform .15s var(--ease), background .2s, color .2s;
}
.plan__cta:hover { transform: translateY(-1px); background: var(--accent-soft); }
.plan--highlight .plan__cta { background: var(--accent); color: #fff; }
.plan--highlight .plan__cta:hover { background: var(--accent-ink); }
.plan__cta:disabled { opacity: 0.5; cursor: default; border-color: var(--line-2); color: var(--muted-fg); background: var(--surface-2); transform: none; }

.auth-fine { font-size: 11.5px; color: var(--muted-fg); text-align: center; margin: 12px 2px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
  padding: 13px 20px; border-radius: 14px; box-shadow: var(--shadow-lg);
  max-width: 90vw; opacity: 0; transition: opacity 0.3s, transform 0.3s var(--ease-out); z-index: 50;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { background: #8C1024; }

/* ---------- footer ---------- */
.footer {
  text-align: center; padding: 34px 24px 44px; color: var(--muted-fg); font-size: 14px;
}
.footer p { margin: 4px 0; }
.footer strong { font-family: var(--serif); color: var(--accent); font-weight: 600; font-style: italic; }
.footer__tagline { font-size: 15px; }
.footer__company {
  margin: 18px auto 0; padding-top: 18px; max-width: 460px;
  border-top: 1px solid var(--line);
}
.footer__name {
  font-family: var(--serif); font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em; color: var(--ink-2);
}
.footer__row { font-size: 13px; }
.footer__row a { color: var(--muted-fg); text-decoration: none; transition: color 0.2s; }
.footer__row a:hover { color: var(--accent); }
.footer__dot { margin: 0 6px; opacity: 0.5; }
.footer__fine { font-size: 12px; opacity: 0.75; margin-top: 16px; }

/* ---------- keyframes ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.6); opacity: 0.6; } }
@keyframes indeterminate { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* ---------- responsivo ---------- */
@media (max-width: 880px) {
  .plans__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .topnav__link { display: none; }
  .composer__actions { flex-direction: column; align-items: stretch; }
  .composer__hint { text-align: center; }
  .btn-process { justify-content: center; }
  .result__head { flex-direction: column; align-items: flex-start; }
  .result__tools { width: 100%; flex-wrap: wrap; }
  .plans__grid { grid-template-columns: 1fr; }
}

/* ---------- acessibilidade: menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .blob { display: none; }
}
