/* Base theme — reset, typography, buttons, forms, shared utilities. */

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

/* ---- Motion ----
   Restrained by design (MOTION_INTENSITY ~4: fluid CSS transitions plus a
   scroll-reveal layer, no scroll-hijacking or parallax) — this is a
   professional B2B production site, not an agency portfolio. Every
   animated element here degrades to fully visible, non-animated content
   when JS is unavailable or prefers-reduced-motion is set. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scroll-reveal: `.reveal` is added by scroll-reveal.js to a known set of
   repeating content blocks (cards, section heads, grid items) — never in
   markup, so a no-JS visitor always sees full content immediately, no
   opacity:0 trap. `.is-visible` is added by the same script's
   IntersectionObserver callback once the element enters the viewport. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Hero load-in: pure CSS keyframes (not JS-gated) since the hero is always
   above the fold and visible on first paint regardless of script state —
   safe to animate unconditionally, reduced-motion override above still
   collapses it to instant. */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.fade-up-in {
  animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--color-shell);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-slate-900);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-md); }

@media (max-width: 720px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}

p {
  margin: 0 0 var(--space-4);
}

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

/* One-word/phrase accent highlight inside a headline — solid color, never a
   gradient (see DESIGN-SYSTEM.md typography notes). Use sparingly: at most
   once per headline, on the phrase that carries the sentence's real point,
   not decoratively. */
.accent-text { color: var(--color-accent); }
.section-ink .accent-text { color: var(--color-accent-bright); }

/* Spacing utilities — only the increments actually reused across pages;
   not a full scale, to avoid duplicating what section/card components
   already handle via their own padding/margin rules. */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

a {
  color: var(--color-accent-deep);
  text-decoration: none;
}
a:hover { color: var(--color-accent); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Visually hidden but available to assistive tech — e.g. a label for an
   input where a visible caption would clutter a compact row. !important
   because this utility must win over more specific contextual rules (e.g.
   ".field label" in Forms below) wherever it's applied. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--color-slate-900);
  color: var(--color-text-on-ink);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: var(--space-4);
  color: var(--color-text-on-ink);
}

/* ---- Layout helpers ---- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
/* Modifier: a single-column reading/form width (e.g. the Quote form) —
   pairs with .container, e.g. class="container container--narrow". */
.container--narrow { max-width: 760px; }

.section {
  padding: var(--space-9) 0;
}

@media (max-width: 720px) {
  .section { padding: var(--space-7) 0; }
}

.section-shell { background: var(--color-shell); }
.section-surface { background: var(--color-surface); }
.section-sunken { background: var(--color-surface-sunken); }
.section-ink {
  background: var(--color-slate-900);
  color: var(--color-text-on-ink);
}
.section-ink h2, .section-ink h3, .section-ink h4 { color: var(--color-text-on-ink); }
.section-ink .text-muted { color: var(--color-slate-400); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
  margin-bottom: var(--space-3);
}
.section-ink .eyebrow { color: var(--color-accent-bright); }

/* Modifier: a standalone centered eyebrow outside .page-hero (which centers
   its eyebrow by default) — e.g. a centered intro mid-page. */
.eyebrow--center {
  display: flex;
  justify-content: center;
}

.section-head {
  max-width: 640px;
  margin: 0 auto var(--space-7);
  text-align: center;
}
.section-head.align-left {
  margin-left: 0;
  text-align: left;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--color-slate-900);
  color: var(--color-text-on-ink);
}
.btn-primary:hover {
  background: var(--color-accent-deep);
  color: var(--color-text-on-accent);
}

.btn-secondary {
  background: transparent;
  color: var(--color-slate-900);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover {
  border-color: var(--color-accent-deep);
  color: var(--color-accent-deep);
}

.section-ink .btn-secondary {
  color: var(--color-text-on-ink);
  border-color: rgba(240, 241, 242, 0.35);
}
.section-ink .btn-secondary:hover {
  border-color: var(--color-accent-bright);
  color: var(--color-accent-bright);
}

.btn-whatsapp {
  background: #1f8a4c;
  color: #fff;
}
.btn-whatsapp:hover { background: #196e3c; color: #fff; }

.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: var(--text-base); }

/* ---- Forms ---- */

/* Functional form-section divider (Quote form) — distinct from `.eyebrow`
   (which marks marketing/orientation copy): muted, bordered, no accent
   color, purely a chunking aid for a long single-page form. */
.form-section-heading {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: var(--space-7) 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-width) solid var(--color-border);
}
.form-section-heading:first-child { margin-top: 0; }

.field {
  margin-bottom: var(--space-5);
}

fieldset.field {
  border: none;
  padding: 0;
  min-width: 0;
}

.field label,
.field legend {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  padding: 0;
  color: var(--color-slate-800);
}

.field .hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  padding: 0.75rem 0.9rem;
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

.field-error {
  color: var(--color-danger);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  display: block;
}

/* ---- Work requirements (multi-category selection, Quote form) ---- */

.work-requirements {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.work-requirement-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
}

.work-requirement-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  min-width: 190px;
  min-height: 44px; /* the whole label is the checkbox's tap target */
  flex-shrink: 0;
  margin-bottom: 0;
}

.work-requirement-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.work-requirement-row input[type="text"],
.work-requirement-row input:not([type="checkbox"]):not([type="hidden"]) {
  flex: 1;
  margin: 0;
}

@media (max-width: 560px) {
  .work-requirement-row {
    flex-direction: column;
    align-items: stretch;
  }
  .work-requirement-check {
    min-width: 0;
  }
}

.validation-summary {
  background: var(--color-danger-surface);
  color: var(--color-danger);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.alert-success {
  background: var(--color-success-surface);
  color: var(--color-success);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.alert-success h3 { color: inherit; margin-bottom: var(--space-2); }
.alert-success p:last-child { margin-bottom: 0; }
