/* The upload page (SV Transfer). Apple-plain: one card, one primary button,
   44px touch targets, one typeface (Geist, self-hosted), motion only where
   it tells you something. Frosted-glass header and footer (owner,
   2026-10-06, replacing the white bars) frame the flag's cobalt on a
   desktop; on a phone the header and footer sit straight on the blue; the current
   (public/shared/bg-xmb.js) carries the flag's white through the middle.
   Colours from /tokens.css only. */

/* Geist (Vercel), variable weight 100-900, latin subset, OFL-1.1: the same
   type on every phone, where the system font on Android is Roboto. One
   29 KB file, self-hosted (public/fonts/), swapped in without blocking paint. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-5.3.0-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --paper: color-mix(in srgb, white 97%, var(--key));
  --line: color-mix(in srgb, var(--key) 14%, white);
  --text: color-mix(in srgb, black 88%, var(--key));
  --muted: color-mix(in srgb, black 55%, var(--key));
  /* One radius rule (inner = outer minus padding): card 24, boxes 16,
     controls 14, segment thumb 11 (14 - 3 padding); circles and pills 999. */
  --radius: 24px;
  --control: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  background: var(--key);
}

/* Edge to edge on a phone (iPhone 15 Pro Max, iOS 26, 2026-10-05): the
   pages say viewport-fit=cover, so the page runs under the status bar, the
   home indicator and Safari's translucent bars. body's cobalt (above) is
   the page canvas, what overscroll and any bar tint show; the layers below
   are pinned to the top and as tall as the LARGEST viewport (100lvh, 100vh
   where lvh is unknown), so they never stop short when the bars come and
   go; the glass bars grow by the safe-area insets so their words clear the
   notch, the home indicator and the toolbar. On a desktop every inset is 0
   and lvh is the window, so nothing there moves. */

/* The cobalt under the canvas, and all a device without WebGL sees.
   pointer-events: none so nothing (a tap, or Safari's search for fixed bars
   at the screen's edges to tint its toolbars from) treats it as a bar. */
.app-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--key-deep), var(--key) 50%, var(--key-deep));
}

/* The header and footer are frosted glass at 13% (owner, 2026-10-06, from
   the bars mockup's "Escarcha" slider at 13), replacing the white bars and
   their hard 1px borders, on phones and desktops alike. The card's material
   made into bars (desktop; phones have none, see the 640px block at the
   end): a 13% white fill (11.4% at the foot of the gradient), a
   12.6px blur (the mockup's 12-30px scale at 13%) and saturate 140%, a soft
   white hairline on the inside edge instead of a border, and a faint cobalt
   shadow off the page side. Every word on the bars is full-strength white
   with the card's soft cobalt text-shadow. public/t/public.css repeats this
   for the download page; keep the two in step. */
.bar {
  --bar-line: rgb(255 255 255 / 0.22);
  --bar-glow: color-mix(in srgb, var(--key-deep) 60%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgb(255 255 255 / 0.13), rgb(255 255 255 / 0.114));
  -webkit-backdrop-filter: blur(12.6px) saturate(140%);
  backdrop-filter: blur(12.6px) saturate(140%);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.3;
  color: white;
  text-shadow: 0 1px 1px color-mix(in srgb, var(--key-deep) 40%, transparent);
}
.bar.top { box-shadow: inset 0 -1px 0 var(--bar-line), 0 10px 30px -18px var(--bar-glow); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.bar.bottom { box-shadow: inset 0 1px 0 var(--bar-line), 0 -10px 30px -18px var(--bar-glow); flex-wrap: wrap; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.bar a,
.bar .links a { color: white; text-decoration: none; font-weight: 500; }
.bar a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bar a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }
.bar .brand { font-size: 19px; line-height: 1; font-weight: 650; letter-spacing: -0.035em; display: inline-flex; align-items: center; gap: 9px; }
/* The mark: the current on cobalt, B3 + Line 3 (Esco, 2026-09-29), ringed
   with a faint white line so its cobalt holds its edge on the glass. */
.bar .brand-mark { width: 26px; height: 26px; border-radius: 6px; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.3); }
/* The glass's fallbacks (desktop only; phones have no bars, below).
   No backdrop-filter: no frost to lift the white words off the current, so a
   deep cobalt fill instead (white on it is about 9:1). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (min-width: 641px) {
    .bar { background: var(--key-deep); background: color-mix(in srgb, var(--key-deep) 92%, transparent); }
  }
}
/* No transparency wanted: solid, as the card does (public/shared/glass.css). */
@media (prefers-reduced-transparency: reduce) and (min-width: 641px) {
  .bar { background: var(--key-deep); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.stage {
  flex: 1;
  display: grid;
  /* One column no wider than the screen: an auto column grew to fit a long
     file name (which never wraps) and pushed the card off a phone. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 28px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
}

.card {
  /* The page's tokens declare a dark ground, which gives native controls
     (radios, checkboxes, scrollbars) dark faces. The card is white. */
  color-scheme: light;
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 16px 48px rgb(0 0 0 / 0.22);
}

/* No SVG lens on this page's glass. With the Turnstile iframe inside the
   card, Chrome sometimes paints the card's own content through the
   url(#lens) displacement, so the form below the file list goes blurred and
   warped and can't be used (live, 2026-10-02). Blur and saturation keep the
   glass look; other pages keep the lens. */
body .card {
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}

/* The upload card, compact (live run, 2026-10-02): at 1440x800 it ran past
   the fold and covered the flag's white band, so the blue-white-blue was
   lost. Tighter spacing here only (#card is the upload page's); the legal
   pages and the Link Page share this file and keep theirs. */
#card { padding: 22px 24px 20px; }
#card .sub { margin-bottom: 14px; }
#card .drop { padding: 16px; }
#card .plus { margin-bottom: 2px; }
#card .dropzone { margin-top: 10px; }
#card .segmented:not(.days) { margin: 12px 0 0; }
#card .field { margin-top: 10px; }
#card .field > span { margin-bottom: 4px; }
/* The robot check, when Cloudflare shows it (enviar.js watchRobotBox sets
   .shown): 12 px above, and the button's own 12 px below, the card's rhythm,
   with the fields' rounded corners. */
#card .turnstile { margin-top: 0; }
#card .turnstile.shown { margin-top: 12px; border-radius: var(--control); overflow: hidden; }
#card .primary { margin-top: 12px; }
#card .fine { margin-top: 8px; font-size: 12.5px; line-height: 1.45; letter-spacing: 0.005em; }
/* The empty drop box is one row, plus beside its words (Esco, 2026-10-02):
   with the fields in email mode the card has to fit at 1440x800. Narrow
   phones keep the stacked box. */
@media (min-width: 421px) {
  #card .drop { flex-direction: row; justify-content: center; align-items: center; gap: 10px; padding: 12px 16px; }
  #card .plus { margin-bottom: 0; flex: none; }
  #card .drop-title, #card .drop-hint { white-space: nowrap; }
}
@media (max-width: 420px) {
  #card { padding: 20px 18px 18px; }
}

/* Type scale: weight, size and leading together; display text tracks tight,
   body near zero, small text a touch open. Every line-height is explicit so
   the card's height does not depend on the font's metrics. */
h1 { margin: 0 0 4px; font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -0.028em; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 16px; line-height: 1.45; letter-spacing: -0.006em; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 16px;
  border: 1.5px dashed var(--line); /* glass.css redraws it as a fine SVG dash */
  border-radius: 16px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s;
}
.drop:hover, .drop.over, .dropzone.over .drop { background: var(--paper); border-color: var(--key); }
.plus {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--key);
  color: white;
  line-height: 1;
}
.ic { display: block; width: 1em; height: 1em; flex: none; }
.plus .ic { width: 18px; height: 18px; }
.drop-title { font-size: 17px; line-height: 1.25; font-weight: 600; letter-spacing: -0.012em; }
.drop-hint { font-size: 14px; line-height: 1.3; color: var(--muted); }

/* With files, the box becomes the list (Esco, 2026-10-01): same border and
   corners as the empty box, so the files read as having landed in it. */
.filebox {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2px 14px 10px;
  transition: background-color 0.15s, border-color 0.15s;
}
.dropzone .filebox.over, .dropzone.over .filebox { background: var(--paper); border-color: var(--key); }
.filebox .files { margin-top: 0; }
.filebox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.add-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: var(--key);
  cursor: pointer;
}
.add-more span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--key);
  color: white;
  line-height: 1;
}
.add-more span .ic { width: 14px; height: 14px; }
.filebox-foot .total { margin: 0; }

/* A row just added drops into the box. */
@keyframes land {
  from { opacity: 0; transform: translateY(-14px) scale(0.97); }
  60% { opacity: 1; transform: translateY(2px) scale(1); }
  to { opacity: 1; transform: none; }
}
.files li.landing { animation: land 0.32s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
@media (prefers-reduced-motion: reduce) {
  .files li.landing { animation: none; }
  .filebox { transition: none; }
}

.files { list-style: none; margin: 14px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.files li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}
.files li:last-child { border-bottom: 0; }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.3; }
.files .size { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.files .remove {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-right: -12px;
  border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer;
}
/* During the upload: the same rows, each with its own bar and percent. */
.files.uploading { max-height: 260px; }
.files.uploading li { padding: 8px 0; min-height: 0; }
.file-status { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.files li.complete .file-status { color: var(--key); }
.files li.failed .file-status { color: var(--error, #c62828); font-weight: 600; }

.total { margin: 8px 0 0; font-size: 14px; line-height: 1.3; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.total.over { color: var(--error, #c62828); }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 20px 0 6px;
  padding: 3px;
  border-radius: var(--control);
  background: var(--paper);
  border: 1px solid var(--line);
}
.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  background: none;
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500; /* the same in both states: only the colour changes */
  letter-spacing: -0.006em;
  color: var(--muted);
  cursor: pointer;
}
.segmented button[aria-checked="true"] {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--key-deep) 25%, transparent);
}

/* One line (Esco, 2026-10-04, free only): "Disponible por" on the left, the
   small day picker [1][3][7] on the right, centred on each other. */
/* One phrase, read left to right: "Disponible por [1][3][7] días". */
.expiry-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
/* The unit after the picker (Esco, 2026-10-04): without the PLUS/PRO pills,
   "Disponible por [1][3][7]" did not say what the numbers were. */
.expiry-pick { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.expiry-cap { font-size: 13.5px; line-height: 1.25; font-weight: 500; letter-spacing: 0.003em; color: var(--muted); white-space: nowrap; }
.expiry .segmented.days {
  display: inline-grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 34px;
  flex: none;
  margin: 0;
}
.expiry .segmented.days button { min-height: 30px; padding: 0; font-size: 14px; font-weight: 550; letter-spacing: 0; font-variant-numeric: tabular-nums; }

.field { display: block; margin-top: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13.5px; line-height: 1.25; font-weight: 500; letter-spacing: 0.003em; color: var(--muted); }
.field em { font-style: normal; font-weight: 400; font-size: inherit; letter-spacing: inherit; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px; /* 16px: iOS does not zoom the page into the field */
  line-height: 20px;
  font-weight: 450;
  letter-spacing: -0.005em;
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--control);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* One line tall until typed in; enviar.js sets the height as the text grows. */
textarea { resize: none; display: block; overflow-y: hidden; min-height: 44px; height: 44px; }
@media (prefers-reduced-motion: no-preference) {
  textarea { transition: border-color 0.15s, box-shadow 0.15s, height 0.14s ease-out; }
}
input:focus-visible, textarea:focus-visible { border-color: var(--key); box-shadow: 0 0 0 3px color-mix(in srgb, var(--key) 20%, transparent); }
.code { letter-spacing: 0.4em; font-size: 22px; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }

/* No box of its own: the robot check shows only when Cloudflare needs a
   click (interaction-only), and then the iframe sizes it. */
.turnstile { margin-top: 0; }
.turnstile:has(iframe):not(:has([style*="display: none"])) { margin-top: 14px; }
/* Ticked and done (enviar.js syncRobotBox): out of the card until a new
   check needs it. */
.turnstile.solved { display: none; }

.primary, .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  border-radius: var(--control);
  font: inherit;
  font-size: 17px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
  cursor: pointer;
  /* Press in fast, let go slowly; transform, shadow and colour only. */
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 150ms;
}
.primary { border: 0; background: var(--key); color: var(--key-on, white); }
/* The code step's two buttons (Esco, 2026-10-02): the webmail shortcut and
   "Confirmar y transferir" share one grid and the same metrics; enviar.js only
   swaps which one wears .primary and which .secondary, so nothing moves. */
.code-actions { display: grid; gap: 10px; margin-top: 20px; }
#card .code-actions .primary, .code-actions .secondary { margin-top: 0; }
.code-actions .primary, .code-actions .secondary { box-sizing: border-box; border-width: 1px; border-style: solid; }
.code-actions .primary { border-color: var(--key); }
.code-actions [hidden] { display: none; }
/* After a failed upload: "Intentar de nuevo" with "Volver" under it. */
.actions { margin-top: 16px; }
.secondary { margin-top: 10px; border: 1px solid var(--line); background: white; color: var(--key); }
.primary:disabled { cursor: default; transform: none; }
.link {
  display: block;
  margin: 14px auto 0;
  min-height: 44px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  color: var(--key);
  cursor: pointer;
}

.error { margin: 14px 0 0; color: var(--error, #c62828); font-size: 15px; line-height: 1.4; }

.progress { height: 8px; margin-top: 8px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--key); border-radius: 4px; transition: width 0.25s; }
.percent { margin: 10px 0 0; font-size: 15px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }

.check {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin-bottom: 14px;
  border-radius: 50%; background: var(--key); color: white;
}
.check .ic { width: 28px; height: 28px; }
/* Under the code step's line: SwissTransfer's "check your spam folder". */
.hint { margin: -12px 0 18px; font-size: 14px; line-height: 1.4; color: var(--muted); }

/* While the card glides to its new height (enviar.js morph), nothing may
   spill out of it. */
.card.morphing { overflow: hidden; }

/* Every tap answers at once (Esco, 2026-10-02): the small controls give
   under the finger the way the big buttons already did, and the done
   check lands with a little give. None of it under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .segmented button, .link, .remove, .add-more, .drop { transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 150ms, border-color 150ms; }
  .segmented button:active, .link:active, .remove:active, .add-more:active, .drop:active { transform: scale(0.97); transition-duration: 90ms; }
  .primary:not(:disabled):active, .secondary:active { transform: scale(0.98); transition-duration: 90ms; }
  .plus { transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .drop:hover .plus, .drop.over .plus, .dropzone.over .plus { transform: scale(1.06); }
  .step:not([hidden]) .check { animation: check-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
  @keyframes check-in {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: none; }
  }
}

.summary { margin-top: 6px; font-size: 14px; line-height: 1.4; opacity: 0.85; }
.link-box input { font-size: 15px; color: var(--key); background: var(--paper); }

/* WhatsApp with the link's QR code beside it (Esco, 2026-10-02). The code
   sits on its own white tile so any phone camera reads it on the glass. */
.share-qr { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; margin-top: 10px; }
.share-qr .qr { width: 112px; height: 112px; padding: 6px; border-radius: 12px; background: white; }
.share-qr .qr svg { display: block; width: 100%; height: 100%; }
.share-side .secondary { margin-top: 0; padding: 8px 12px; font-size: 16px; line-height: 1.25; text-align: center; }
.qr-caption { margin: 8px 0 0; font-size: 13px; line-height: 1.35; color: var(--muted); }
.share-qr.no-qr { display: block; }
.share-qr.no-qr .qr, .share-qr.no-qr .qr-caption { display: none; }

/* The done card's rhythm (Esco, 2026-10-04: the two text links sat about
   58 px apart and the card ended in empty space). Text: title, line, then the
   summary 8 px under it; 16 px to the actions. Actions (link box, Copiar,
   QR + WhatsApp) 10 px apart. Then the two text links as one small, quieter
   group: 36 px rows with no gap (16 px between the lines of text), 22 px of
   air above, and the last row's spare 8 px taken back from the card's foot
   so the bottom matches the top. */
#step-done .sub { margin-bottom: 0; overflow-wrap: anywhere; } /* a long address wraps inside the card */
#step-done .summary { margin: 8px 0 16px; }
#card #step-done #copy { margin-top: 10px; }
#step-done .share-qr { margin-bottom: 14px; }
#step-done .link { min-height: 36px; margin: 0 auto; padding: 0 12px; font-size: 14px; color: rgb(255 255 255 / 0.9); }
#step-done .link:last-child { margin-bottom: -8px; }

/* The upload step: the last file row's own padding doubled the card's foot. */
#step-upload .files.uploading li:last-child { padding-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; } /* the segment thumb is a ::before */
}
/* The tagline is one line or nothing: "Hasta 5 GB por transferencia, sin
   cuenta" is plain text (Esco, 2026-10-04) and hides under about 640 px. */
.tagline { white-space: nowrap; }
@media (max-width: 640px) {
  .tagline { display: none; }
}
@media (max-width: 420px) {
  .card { padding: 24px 18px; }
  h1 { font-size: 26px; line-height: 1.12; }
  /* A 36 px target for the day buttons (30 on a desktop). */
  .expiry .segmented.days button { min-height: 36px; }
}

/* -- FLOWOPS-SIGNATURE -------------------------------------------------

########################################################################################################################
#                                                                                                                      #
#                                                                                                                      #
#                                                                                                                      #
#                                                                                                                      #
                                                                                                                    ##
                             ####                                                                                   ##
                             ####            ####                                                                   ##
                                             ####                                                                   ##
  ######   #######     ##########   ######  ##########     ######   ##  ##    ##   ###    ###   ### ######    #    ###
#####    ########### ############ ####  ###############   #######      ##      ### ###     ##   ###     ##  ##      ##
 ###### ####     #######     ############### ####   #### ####  #####  ###      ### ###     ##   ###     ##  ##      ##
    ########     #######     ########        ####    #######       ### ##      ### ###     ##   ###     ##  ##      ##
#################### ############ ########## ######   #####   ##   ##  ###    ###  ####   ###   ###     ##  ####    ##
 ######     #####       ########     #####     ####   ####                            ##                       ##
                                                     ####
                                                   #####
#                                                                                                                      #
#                                                                                                                      #
#                                                                                                                      #
#                                                                                                                      #
########################################################################################################################


                                              #                #              #
                                                    #                      #

                                  Built by Esco and Claude.

*/

/* The report page's reasons (/reportar/), and screen-reader-only text. */
.reasons { margin: 0; padding: 0; border: 0; }
.reasons label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  cursor: pointer;
}
.reasons input { width: 20px; height: 20px; accent-color: var(--key); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bar.bottom a + a { margin-left: 16px; }
.fine { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.4; }
.fine a, .links a { color: var(--key); }
.links a + a { margin-left: 14px; }

/* The legal pages (/terminos/, /privacidad/): the same card, wider, for reading. */
.card.prose { max-width: 680px; font-size: 16px; line-height: 1.6; }
.prose h1 { margin-bottom: 12px; }
.prose h2 { margin: 26px 0 8px; font-size: 19px; }
/* No bullet markers beside words (Esco, 2026-10-04): each item already opens
   with its bold lead-in, so the list reads without them. */
.prose ul { list-style: none; padding-left: 0; }
.prose li { margin: 10px 0; }
.prose a { color: var(--key); }

/* The Español / English switch (lib/middleware.ts serves the page in the
   chosen language). Stays visible on a phone, where the tagline hides. */
.bar .right { display: inline-flex; align-items: center; gap: 16px; }
.bar .lang-switch { font-size: 14px; line-height: 1.3; font-weight: 600; white-space: nowrap; }

/* "2 de 10" on the Para line: same line height as the label, so no extra card height. */
.field > .field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-head .count { font-variant-numeric: tabular-nums; font-weight: 400; white-space: nowrap; opacity: 0.8; }
.field-head .count[hidden] { display: none; }
.field-head .count.over { color: var(--error, #c62828); opacity: 1; font-weight: 600; }

/* ==== Weather (Esco, 2026-10-02/04; v2 owner approved 2026-10-04) =========
   #card[data-weather="clear|sun|partly|cloud|sunset|rain|storm"]. The scene
   (rain, the sun on its day path, Nublado's faint sun patch) is drawn by the
   background shader (public/shared/bg-xmb.js, u_weather) and the card's own
   backdrop-filter blurs it, as on iOS Weather. Rain drops are a canvas BEHIND
   the card (public/enviar/weather-glass.js). These rules are the glass:
   frost, haze, the rim glint that follows the sun, the shared dusk warmth.
   enviar.js sets data-weather from GET /api/public/weather (MET Norway);
   ?wx=clear|sun|partly|cloud|sunset|rain|storm overrides it for testing. */
#card { position: relative; isolation: isolate; }
#card[data-weather="cloud"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
}

/* cloud: a touch more frost on the whole glass, and a milky haze on the top band */
#card[data-weather="cloud"] {
  backdrop-filter: blur(6px) saturate(80%);
  -webkit-backdrop-filter: blur(6px) saturate(80%);
}
#card[data-weather="cloud"]::before {
  background:
    radial-gradient(ellipse 55% 70px at 18% 0, rgb(238 243 252 / 0.34), transparent),
    radial-gradient(ellipse 50% 56px at 78% 0, rgb(238 243 252 / 0.26), transparent),
    linear-gradient(180deg, rgb(238 243 252 / 0.2), rgb(238 243 252 / 0.07) 36px, transparent 72px);
}

/* storm gets the SAME grey glass as cloud (frost + milky top haze). Its
   ::before/::after belong to the flash layers below, so the haze lives on the
   card's own background-image here (same gradients as cloud's ::before). */
/* (Esco, 2026-10-04): the storm's grey comes from COLOUR, not blur --
   the 6px frost erased the drops behind the glass. Same light frost as Lluvia
   (2px), less saturation, and a grey wash over the whole pane. */
/* (Esco, 2026-10-04): the rain drops sit BEHIND the card again, so
   while it rains the frost is a little thinner (2px -> 1.2px): soft, but
   each drop still reads as a lens with its dark top crescent. */
#card[data-weather="rain"] { --glass-blur: 1.2px; }
#card[data-weather="storm"] {
  backdrop-filter: blur(1.2px) saturate(70%);
  -webkit-backdrop-filter: blur(1.2px) saturate(70%);
  background-image:
    linear-gradient(180deg, rgb(150 160 178 / 0.30), rgb(120 130 150 / 0.22)),
    radial-gradient(ellipse 55% 70px at 18% 0, rgb(238 243 252 / 0.34), transparent),
    radial-gradient(ellipse 50% 56px at 78% 0, rgb(238 243 252 / 0.26), transparent),
    linear-gradient(180deg, rgb(238 243 252 / 0.2), rgb(238 243 252 / 0.07) 36px, transparent 72px),
    linear-gradient(180deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.06)); /* the glass's own fill, kept */
}

/* Sunset hand-off (owner approved 2026-10-04): Sol, Parcial and Atardecer share ONE
   warm glass that scales with --wx-dusk (0 by day .. 1 at sunset, written by
   weather-glass.js from the shader's dusk, which comes from the real
   sunrise and sunset), so Sol as the sunset window opens
   and Atardecer are the same frame -- no jump between modes.
   At dusk 1 these are the Atardecer values: an amber border and inset
   rim. The amber glint along the top edge and its warm glow now follow the
   sun (--wx-rim-x) instead of sitting at fixed spots; they are on ::before
   below with the sun's sheen. */
#card[data-weather="sun"],
#card[data-weather="partly"],
#card[data-weather="sunset"] {
  --dk: calc(var(--wx-dusk, 0) * 100%);
  border-color: color-mix(in srgb, rgb(255 196 150 / 0.55) var(--dk), rgb(255 255 255 / 0.28));
  border-top-color: color-mix(in srgb, rgb(255 214 170 / 0.85) var(--dk), rgb(255 255 255 / 0.6));
  box-shadow:
    0 1px 0 color-mix(in srgb, rgb(255 226 190 / 0.5) var(--dk), rgb(255 255 255 / 0.35)) inset,
    0 0 0 0.5px color-mix(in srgb, rgb(255 190 140 / 0.3) var(--dk), rgb(255 255 255 / 0.2)) inset,
    0 0 16px -5px color-mix(in srgb, rgb(255 150 90 / 0.5) var(--dk), transparent) inset,
    0 0 26px -8px color-mix(in srgb, rgb(255 160 80 / 0.4) var(--dk), transparent),
    0 30px 70px -28px color-mix(in srgb, var(--key-deep) 70%, black);
}

/* ---- the glass reacts to the sun and the storm ------------------
   public/enviar/weather-glass.js writes --wx-sun, --wx-flash, --wx-sun-x/-y
   (unit vector card -> sun) and --wx-rim-x/-y (where that ray leaves the card,
   in %) on #card every frame it changes. Two pointer-events:none layers UNDER
   the content: ::before is a faint sheen, ::after a 1px rim ring (the card's
   border box, masked to the border). Rim peaks stay under the sunset rim
   (alpha .85 on the top edge). Rain's drops are a <canvas> behind the card. */
#card[data-weather="sun"]::before,
#card[data-weather="sun"]::after,
#card[data-weather="partly"]::before,
#card[data-weather="partly"]::after,
#card[data-weather="sunset"]::before,
#card[data-weather="sunset"]::after,
#card[data-weather="storm"]::before,
#card[data-weather="storm"]::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  border-radius: inherit;
}
#card[data-weather="sun"]::before,
#card[data-weather="partly"]::before,
#card[data-weather="sunset"]::before,
#card[data-weather="storm"]::before { inset: 0; }
#card[data-weather="sun"]::after,
#card[data-weather="partly"]::after,
#card[data-weather="sunset"]::after,
#card[data-weather="storm"]::after {
  inset: -1px;
  border: 2px solid transparent;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
}
/* sun: warm glint on the edges facing it, fading along the border; a very
   faint warm sheen across the top-left of the glass. Other edges stay cool. */
#card[data-weather="sun"]::after,
#card[data-weather="partly"]::after,
#card[data-weather="sunset"]::after {
  background: radial-gradient(circle 360px at var(--wx-rim-x, 0%) var(--wx-rim-y, 0%),
    color-mix(in srgb, rgb(255 180 100 / 0.95) var(--dk), rgb(255 218 170 / 0.9)),
    color-mix(in srgb, rgb(255 150 90 / 0.5) var(--dk), rgb(255 200 150 / 0.45)) 40%, transparent);
  opacity: var(--wx-sun, 0);
}
#card[data-weather="sun"]::before,
#card[data-weather="partly"]::before,
#card[data-weather="sunset"]::before {
  background:
    /* Atardecer's amber glint along the top edge, fading in with dusk */
    linear-gradient(90deg, transparent 6%,
      color-mix(in srgb, rgb(255 184 96 / 0.9) var(--dk), transparent) 28%,
      color-mix(in srgb, rgb(255 140 110 / 0.85) var(--dk), transparent) 74%, transparent 94%) top / 100% 1.5px no-repeat,
    /* its warm top glow, now centred under the sun instead of fixed */
    radial-gradient(ellipse 62% 66px at var(--wx-rim-x, 0%) 0, color-mix(in srgb, rgb(255 170 90 / 0.38) var(--dk), transparent), transparent),
    radial-gradient(circle 150px at var(--wx-rim-x, 0%) var(--wx-rim-y, 0%), rgb(255 190 130 / 0.2), transparent),
    radial-gradient(ellipse 70% 55% at 0% 0%, color-mix(in srgb, transparent var(--dk), rgb(255 226 190 / 0.1)), transparent 70%);
  opacity: var(--wx-sun, 0);
}
/* Parcial (owner approved 2026-10-04): the cloud glass, a little lighter than Nublado
   (4px frost, a fainter milky band; it lives on background-image because
   ::before/::after carry the sun here). The rim glint and sheen are Sol's at
   ~65% strength; --wx-sun is the effective sun (0.55 dim, up to 1 in a cloud
   gap), so they brighten with it. */
#card[data-weather="partly"] {
  backdrop-filter: blur(4px) saturate(95%);
  -webkit-backdrop-filter: blur(4px) saturate(95%);
  background-image:
    radial-gradient(ellipse 55% 70px at 18% 0, rgb(238 243 252 / 0.24), transparent),
    radial-gradient(ellipse 50% 56px at 78% 0, rgb(238 243 252 / 0.18), transparent),
    linear-gradient(180deg, rgb(238 243 252 / 0.14), rgb(238 243 252 / 0.05) 36px, transparent 72px),
    linear-gradient(180deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.06)); /* the glass's own fill, kept */
}
#card[data-weather="partly"]::after,
#card[data-weather="partly"]::before { opacity: calc(var(--wx-sun, 0) * 0.65); }
/* storm: the border and a thin band on top brighten with the background flash */
#card[data-weather="storm"]::after {
  background: linear-gradient(rgb(214 228 255 / 0.7), rgb(214 228 255 / 0.7));
  opacity: var(--wx-flash, 0);
}
#card[data-weather="storm"]::before {
  background: linear-gradient(180deg, rgb(226 236 255 / 0.2), rgb(226 236 255 / 0.06) 28px, transparent 64px);
  opacity: var(--wx-flash, 0);
}
@media (prefers-reduced-motion: reduce) {
  #card[data-weather="storm"]::before,
  #card[data-weather="storm"]::after { opacity: 0; }
}

/* ==== end weather ==== */

/* The weather line in the footer: quiet, one line, tabular figures. Hidden
   (the hidden attribute) until a temperature is known. */
.wx-now { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; color: var(--text); }
.bar .wx-now, .bar .wx-now .wx-credit, .bar .foot-note, .bar .tagline { color: white; }
.wx-now[hidden] { display: none; }
.wx-now .wx-loc { font-weight: 600; letter-spacing: 0.04em; }
.wx-now .wx-credit { font-size: 12px; font-weight: 450; font-style: italic; color: var(--muted); }
.bar.bottom { row-gap: 6px; }
/* The upload page's footer has three parts; the middle note sits on the page's
   centre line, under the card, whatever the two sides measure (Esco,
   2026-10-04: it drifted left of the card). Each part keeps its own column,
   so the note stays centred when the weather line is hidden. */
@media (min-width: 641px) {
  .bar.bottom:has(.foot-note) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 24px; }
  .bar.bottom:has(.foot-note) .wx-now { grid-column: 1; justify-self: start; }
  .bar.bottom:has(.foot-note) .foot-note { grid-column: 2; text-align: center; }
  .bar.bottom:has(.foot-note) .links { grid-column: 3; justify-self: end; }
}

/* Phones (owner, 2026-10-05, on #49): the blue takes the space. The bars
   (frosted glass since 2026-10-06) stop at the safe areas -- the header starts below the status bar,
   the footer ends above the home indicator and Safari's bottom toolbar --
   and the moving cobalt (#app-bg-xmb, 100lvh) fills the insets as margin.
   Both bars are slimmer: 4-6 px of padding, every link a 36 px tap target,
   and the footer on two lines (the weather line and the links, then the
   note in a smaller size) instead of three. Desktop is untouched. */
@media (max-width: 640px) {
  /* 16 px sides, the card's own gutter, so the footer's weather line and
     links share one line on a 430 px phone (narrower phones wrap them). */
  .bar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .bar.top {
    margin-top: env(safe-area-inset-top, 0px);
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .bar.bottom {
    margin-bottom: env(safe-area-inset-bottom, 0px);
    padding-top: 4px;
    padding-bottom: 6px;
    row-gap: 0;
    column-gap: 8px;
  }
  .bar .brand,
  .bar .lang-switch,
  .bar.bottom a { display: inline-flex; align-items: center; min-height: 36px; }
  .bar.bottom { font-size: 12.5px; }
  .bar.bottom .wx-now { order: 1; gap: 6px; }
  .bar.bottom .links { order: 2; margin-left: auto; }
  .bar.bottom .foot-note { order: 3; flex-basis: 100%; font-size: 12px; line-height: 1.3; }
  .bar.bottom .wx-now .wx-credit { min-height: 0; font-size: 11.5px; }
  .links a + a { margin-left: 8px; }
}

/* Phones (owner, 2026-10-06, correcting #51): NO bars, the mockup's "Sin
   barras" (option 4). No fill, blur, hairline or shadow: the mark, the name,
   "English", the weather line, the note and the links sit straight on the
   moving cobalt, white, each with the card's soft cobalt text-shadow plus a
   wider halo, so they hold where the white current passes behind them. A
   deep-cobalt shading at the top and bottom edges (55% at the edge, 52%
   across the words, to nothing; not a bar, no edge) keeps every word at AA.
   Text: all full white (the mockup's 84% note and 78% credit were raised
   after the AA check). The safe-area margins, slim heights and footer layout
   above stay; the footer gets 8 px of air under the card, since nothing
   frames it any more. Desktop keeps the 13% glass. */
@media (max-width: 640px) {
  .bar {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    color: rgb(255 255 255 / 0.84);
    text-shadow: 0 1px 1px color-mix(in srgb, var(--key-deep) 45%, transparent), 0 0 10px color-mix(in srgb, var(--key-deep) 35%, transparent);
  }
  /* The edge shading (owner, 2026-10-06, after the AA check on #51): deep
     cobalt from 55% at the screen edge, holding 52% across the words, then
     fading to nothing 28 px past the bar (the stage's own padding, so it
     never reaches the card). It covers the safe-area inset too, so there is
     no line where the bar starts: shading, not a bar. 52% keeps white words
     at or above 4.5:1 even where the white current passes right behind. It
     sits on a ::before under the words (the bar isolates it). */
  .bar { position: relative; isolation: isolate; }
  .bar::before { content: ""; position: absolute; left: 0; right: 0; z-index: -1; pointer-events: none; }
  .bar.top { box-shadow: none; background: transparent; }
  .bar.bottom { box-shadow: none; background: transparent; padding-top: 8px; }
  /* Header words end about 11 px above the bar's foot; footer words start about 16 px below its top. */
  .bar.top::before { top: calc(-1 * env(safe-area-inset-top, 0px)); bottom: -28px; background: linear-gradient(to bottom, color-mix(in srgb, var(--key-deep) 55%, transparent), color-mix(in srgb, var(--key-deep) 52%, transparent) calc(100% - 39px), transparent); background: linear-gradient(to bottom, rgb(from var(--key-deep) r g b / 0.55), rgb(from var(--key-deep) r g b / 0.52) calc(100% - 39px), rgb(from var(--key-deep) r g b / 0)); }
  .bar.bottom::before { top: -28px; bottom: calc(-1 * env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, color-mix(in srgb, var(--key-deep) 55%, transparent), color-mix(in srgb, var(--key-deep) 52%, transparent) calc(100% - 44px), transparent); background: linear-gradient(to top, rgb(from var(--key-deep) r g b / 0.55), rgb(from var(--key-deep) r g b / 0.52) calc(100% - 44px), rgb(from var(--key-deep) r g b / 0)); }
  .bar a, .bar .links a { color: #fff; }
  .bar a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(255 255 255 / 0.5); }
  .bar a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
  .bar .brand-mark { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.35), 0 2px 8px color-mix(in srgb, var(--key-deep) 35%, transparent); }
  .bar .tagline { color: rgb(255 255 255 / 0.78); }
  .bar .wx-now { color: #fff; }
  /* Full white (owner, 2026-10-06): at 84% / 78% they fell under 4.5:1
     where the current passes behind the footer. */
  .bar .wx-now .wx-credit { color: #fff; }
  .bar .foot-note { color: #fff; }
}
