/* ==========================================================================
   Palhete Pizzaria — Base Styles & Typography
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.12rem, 1.8vw, 1.3rem);
  font-weight: 600;
}

h3 {
  font-size: 1.02rem;
  font-weight: 600;
}

p {
  margin: 0;
}

p + p {
  margin-top: var(--space-2);
}

a {
  color: var(--brand-vinho);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-mostarda-text);
}

img, svg {
  display: block;
  max-width: 100%;
}

.ico {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
}

.ico-sm {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}

.ico-lg {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
}

.num,
time,
dd {
  font-variant-numeric: tabular-nums;
}

/* Foco acessível WCAG 2.2 AA */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Skip link para navegação por teclado */
.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 1000;
  background: var(--brand-barbecue);
  color: var(--text-on-dark);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
  box-shadow: var(--focus-ring-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--text-secondary);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

/* Formulários base */
label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label:has(input:not([type="checkbox"])),
label:has(select),
label:has(textarea) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: 400 var(--text-base)/1.4 var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand-vinho);
  outline: none;
  box-shadow: var(--focus-ring);
}

input[readonly] {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: default;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
}

small,
.ajuda {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.45;
}

.opcional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.aceite {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-weight: 400;
  font-size: var(--text-sm);
  cursor: pointer;
  min-height: 2.75rem;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.aceite:hover {
  border-color: var(--border-strong);
  background: var(--bg-canvas);
}

.aceite input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.1rem;
  flex: 0 0 auto;
  accent-color: var(--brand-vinho);
  cursor: pointer;
}
