/*
 * The public site's only stylesheet.
 *
 * The approved templates carry their own styling inline, which is how they were drawn and how they
 * are kept faithful — so this file does not restyle anything. It adds the four things a design file
 * cannot: the phone, the keyboard, motion, and the states that only exist once the page is real.
 *
 * Because the design's styles are inline they win over a stylesheet, so the phone adaptations below
 * use `!important`. That is the deliberate trade: inline styles keep the desktop pixel-exact
 * against the approved design, and these rules bring it down to 360 px without touching them.
 */

/* ---------------------------------------------------------------- base */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #F3F1EC;
  color: #0E1A24;
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  /* A long word in a narrow column is the usual cause of a sideways scrollbar on a phone. */
  overflow-wrap: break-word;
}

/* Nothing is allowed to push the page sideways. Checked at 360 px in CI. */
html, body { max-width: 100%; overflow-x: hidden; }

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

/* ---------------------------------------------------------------- keyboard */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #0E1A24;
  color: #F3F1EC;
  padding: 14px 20px;
  border-radius: 0 0 12px 0;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 0; }

/*
 * A visible focus ring everywhere, in ink on light and in signal orange on the dark panels.
 * The design file has no focus styles because a design file is never tabbed through.
 */
:focus-visible {
  outline: 3px solid #FF5A1F;
  outline-offset: 3px;
  border-radius: 4px;
}

a, button { -webkit-tap-highlight-color: rgba(255, 90, 31, .2); }

/* ---------------------------------------------------------------- animations */

/*
 * Each AI animation ships at its finished state, so with no JavaScript, or with reduced motion
 * asked for, the visitor sees the complete picture rather than an empty card. The script below
 * only ever takes elements away and puts them back; it never has to build one.
 */
.anim [data-s] { transition: opacity .5s ease, transform .5s ease; }

@media (prefers-reduced-motion: reduce) {
  /* The end state, held. No loop, no tick, nothing that moves. */
  .anim [data-s] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation: none !important; }
}

/* ---------------------------------------------------------------- accordions */

.acc-btn { text-align: left; }
.acc-panel[hidden] { display: none; }

/* ---------------------------------------------------------------- the contact form */

form label { font-weight: 600; font-size: 15px; }

form input[type=text], form input[type=email], form input[type=tel], form select, form textarea {
  font: 400 16px 'Instrument Sans', system-ui, sans-serif;   /* 16 px: iOS zooms anything smaller */
  color: #0E1A24;
  background: #FFFFFF;
  border: 1px solid #DDD8CE;
  border-radius: 12px;
  padding: 13px 14px;
  min-height: 48px;
  width: 100%;
}
form textarea { resize: vertical; min-height: 120px; }

form input:invalid:not(:placeholder-shown), form textarea:invalid:not(:placeholder-shown) {
  border-color: #B53A0C;
}

/* The honeypot. Off screen rather than `display:none`, which some bots know to skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-msg:empty { display: none; }
.form-msg[data-state=ok] { color: #1F4A36; font-weight: 600; }
.form-msg[data-state=error] { color: #B53A0C; font-weight: 600; }

button[disabled] { opacity: .6; cursor: progress; }

.turnstile:empty { display: none; }

/* ---------------------------------------------------------------- status page */

.estado-dot { width: 14px; height: 14px; border-radius: 50%; background: #DDD8CE; display: inline-block; }
.estado-dot[data-state=ok] { background: #2E7D5B; }
.estado-dot[data-state=down] { background: #B53A0C; }

/* ---------------------------------------------------------------- the phone */

@media (max-width: 860px) {
  /* The design's 40 px gutters are right at 1280 px and wasteful at 390 px. */
  section, header > div, footer > div { padding-left: 24px !important; padding-right: 24px !important; }
  section { padding-top: 64px !important; padding-bottom: 64px !important; }

  h1 { font-size: 38px !important; line-height: 1.08 !important; }
  h2 { font-size: 28px !important; line-height: 1.15 !important; }
  h3 { font-size: 20px !important; }

  /* Cards lose their deep padding before they lose their content. */
  article, form { padding: 28px !important; }

  /* The menu stacks, each item a full-width row with a real tap target. */
  header nav { gap: 2px 18px !important; }
  header nav a { padding: 12px 0 !important; min-height: 44px; display: flex; align-items: center; }
}

@media (max-width: 480px) {
  section, header > div, footer > div { padding-left: 18px !important; padding-right: 18px !important; }
  h1 { font-size: 32px !important; }
  h2 { font-size: 25px !important; }
  /* A four-column price grid on a phone is four unreadable columns. */
  .anim { min-height: 0 !important; }
}

/* The language switch, sitting in the main nav as one more item. Monospace and uppercase so it
   reads as a control rather than as another page to visit. */
.lang {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: #4A5868; align-self: center;
}
.lang:hover, .lang:focus-visible { color: #0E1A24; text-decoration: underline; }
