/* Q-Cartinha | base compartilhada: tokens, fontes, reset, componentes */

@font-face { font-family: "Young Serif"; font-weight: 400; font-display: swap; src: url("../fonts/young-serif-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Young Serif"; font-weight: 400; font-display: swap; src: url("../fonts/young-serif-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap; src: url("../fonts/figtree-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap; src: url("../fonts/figtree-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Caveat"; font-weight: 500; font-display: swap; src: url("../fonts/caveat-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caveat"; font-weight: 500; font-display: swap; src: url("../fonts/caveat-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --papel: #F5EFE4;
  --papel-2: #EDE4D3;
  --folha: #FFFDF8;
  --tinta: #1D2440;
  --tinta-suave: #545B73;
  --carimbo: #C0392B;
  --carimbo-escuro: #A12F23;
  --kraft: #C7A36F;
  --kraft-claro: #E8D7B8;
  --linha: #E2D8C6;
  --ok: #2E6B47;
  --ok-fundo: #E3EFE5;
  --aviso: #8A5A12;
  --aviso-fundo: #F6EAD2;
  --erro: #A12F23;
  --erro-fundo: #F7E1DD;

  --f-display: "Young Serif", Georgia, "Times New Roman", serif;
  --f-texto: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mao: "Caveat", "Comic Sans MS", cursive;

  --raio: 10px;
  --sombra: 0 1px 0 rgba(29, 36, 64, .06), 0 10px 24px -14px rgba(29, 36, 64, .35);
  --foco: 0 0 0 3px var(--papel), 0 0 0 5px var(--carimbo);

  --dur-entrada: 600ms;
  --dur-hover: 150ms;
  --curva: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --largura: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--f-texto);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--carimbo); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; font-weight: 400; text-wrap: balance; }
h1, h2 { font-family: var(--f-display); }
h1 { font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
small, .small { font-size: .875rem; }
.muted { color: var(--tinta-suave); }
.mao { font-family: var(--f-mao); font-weight: 500; }
:focus-visible { outline: none; box-shadow: var(--foco); border-radius: 4px; }
::selection { background: var(--kraft-claro); color: var(--tinta); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.pular { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--tinta); color: var(--folha); padding: 10px 16px; border-radius: var(--raio); }
.pular:focus { top: 12px; color: var(--folha); }

.container { width: 100%; max-width: var(--largura); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; gap: var(--gap, 12px); align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, 20px); }

.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 28px; height: 28px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--raio);
  border: 1px solid transparent; font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease, color var(--dur-hover) ease, transform var(--dur-hover) ease;
}
.btn:active { transform: translateY(1px); }
.btn--primario { background: var(--carimbo); color: #fff; }
.btn--primario:hover { background: var(--carimbo-escuro); color: #fff; }
.btn--secundario { background: transparent; border-color: var(--tinta); color: var(--tinta); }
.btn--secundario:hover { background: var(--tinta); color: var(--folha); }
.btn--claro { background: var(--folha); border-color: var(--linha); color: var(--tinta); }
.btn--claro:hover { border-color: var(--tinta); color: var(--tinta); }
.btn--fantasma { background: transparent; color: var(--tinta); padding-inline: 12px; }
.btn--fantasma:hover { background: var(--papel-2); color: var(--tinta); }
.btn--perigo { background: transparent; border-color: var(--erro); color: var(--erro); }
.btn--perigo:hover { background: var(--erro); color: #fff; }
.btn--pequeno { min-height: 38px; padding: 0 14px; font-size: .9375rem; }
.btn--bloco { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: girar .7s linear infinite;
}
.btn--secundario.is-loading::after, .btn--claro.is-loading::after { border-color: var(--tinta) var(--tinta) transparent transparent; }
@keyframes girar { to { transform: rotate(360deg); } }

.link-botao { background: none; border: 0; padding: 0; color: var(--tinta); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.link-botao:hover { color: var(--carimbo); }

/* Formulários */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo + .campo, .campo + .campos, .campos + .campo { margin-top: 18px; }
.campos { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.campos > .campo + .campo { margin-top: 0; }
label, .rotulo { font-weight: 600; font-size: .9375rem; }
.opcional { font-weight: 400; color: var(--tinta-suave); }
.entrada, input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="time"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #CFC3AE; border-radius: var(--raio);
  background: var(--folha); color: var(--tinta); font-size: 1rem; line-height: 1.4;
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231D2440' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
input:hover, select:hover, textarea:hover { border-color: var(--tinta-suave); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tinta); box-shadow: 0 0 0 3px rgba(192, 57, 43, .22); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--erro); }
input[type="color"] { width: 48px; height: 48px; padding: 4px; border: 1px solid #CFC3AE; border-radius: var(--raio); background: var(--folha); cursor: pointer; }
.dica { font-size: .875rem; color: var(--tinta-suave); margin: 0; }
.field-error { font-size: .875rem; color: var(--erro); margin: 0; font-weight: 600; }
.marcar { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.marcar input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--carimbo); flex: none; }
.senha-campo { position: relative; }
.senha-campo input { padding-right: 52px; }
.senha-campo button { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--tinta-suave); }

/* Avisos */
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--raio); border: 1px solid; font-size: .9375rem; }
.aviso .icon { margin-top: 2px; }
.aviso p:last-child { margin-bottom: 0; }
.aviso--ok { background: var(--ok-fundo); border-color: #B9D6C0; color: var(--ok); }
.aviso--erro { background: var(--erro-fundo); border-color: #E8B9B2; color: var(--erro); }
.aviso--aviso { background: var(--aviso-fundo); border-color: #E6CF9F; color: var(--aviso); }
.aviso--info { background: var(--folha); border-color: var(--linha); color: var(--tinta); }

/* Superfícies */
.folha { background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); }
.folha--pad { padding: clamp(18px, 3vw, 28px); }
.divisor { border: 0; border-top: 1px solid var(--linha); margin: 24px 0; }

/* Status (só para estado de verdade) */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--ok { background: var(--ok-fundo); color: var(--ok); }
.status--aviso { background: var(--aviso-fundo); color: var(--aviso); }
.status--erro { background: var(--erro-fundo); color: var(--erro); }
.status--neutro { background: var(--papel-2); color: var(--tinta-suave); }

/* Tabelas */
.tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabela { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tabela th, .tabela td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela th { font-size: .8125rem; font-weight: 600; color: var(--tinta-suave); background: var(--papel); white-space: nowrap; }
.tabela tbody tr:hover { background: rgba(237, 228, 211, .45); }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Vazio */
.vazio { text-align: center; padding: 48px 20px; color: var(--tinta-suave); }
.vazio h3 { color: var(--tinta); }

/* Selo do logotipo: picote em SVG via máscara */
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); font-weight: 600; font-size: 1.125rem; letter-spacing: -.01em; }
.marca:hover { color: var(--tinta); }
/* Picote: furos só na borda (faixa do padding); o miolo fica cheio pela camada content-box. */
.selo {
  width: 38px; height: 38px; padding: 3px; display: grid; place-items: center; flex: none;
  background: var(--carimbo); color: #fff; font-family: var(--f-display); font-size: 1.45rem; line-height: 1;
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 2.4px, #0000 95%, #000) -3.8px -3.8px / 7.6px 7.6px round;
  mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 2.4px, #0000 95%, #000) -3.8px -3.8px / 7.6px 7.6px round;
  -webkit-mask-composite: source-over;
  mask-composite: add;
}
.selo span { transform: translateY(1px); }

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