/* "Pide tu video" (page-pide-tu-video.php). Mobile first: phones are most of the traffic. Tokens come from site.css. */

.order {
  --line: color-mix(in srgb, var(--text) 16%, transparent);
  --err: #B3261E;
  --on-action: var(--bg);
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--head) + env(safe-area-inset-top) + 1.25rem) var(--gut) 2rem;
  overflow-wrap: anywhere;
}
@media (prefers-color-scheme: dark) {
  .order { --err: #FF8A80; }
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.sr-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.hp input { font-size: 16px; }

.kicker { font: 600 .75rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.order-intro { padding: .5rem 0 1.5rem; }
.order-intro h1 { font: 700 clamp(2.25rem, 9vw, 4rem)/1 var(--display); letter-spacing: -.02em; margin: 0 0 .75rem; text-wrap: balance; }
.lead { color: var(--muted); margin: 0; max-width: 52ch; }
.order-closed { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }

.order-grid { display: grid; gap: 2rem; align-items: start; min-width: 0; }
.order-form { min-width: 0; }
.step { display: block; padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.sh { display: flex; align-items: center; gap: .6rem; font: 700 1.25rem/1.2 var(--display); margin: 0 0 1rem; }
.sh .n { display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1.5px solid var(--action); color: var(--action); font: 600 .9rem/1 var(--font); }
.hint { font-size: .875rem; color: var(--muted); margin: 0 0 .75rem; }
.lbl, .field > label { font-weight: 600; }
.pay { font-size: .9rem; color: var(--muted); margin: 0 0 1rem; }

/* Duration: two columns on a phone, the "more minutes" card full width. */
.durs { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.card { position: relative; display: grid; gap: .2rem; min-height: 5.5rem; align-content: center; padding: 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.card input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.card:has(input:checked) { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.card:has(input:focus-visible), .chip:has(input:focus-visible), .file:focus-within { outline: 3px solid var(--action); outline-offset: 3px; }
.card .big { font: 700 1.5rem/1.1 var(--display); }
.card .pr { color: var(--muted); font-size: .9rem; }
.card.more { grid-column: 1 / -1; }

.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0 0 1rem; padding: .75rem 1rem; border: 1.5px dashed var(--line); border-radius: 14px; }
.stepper > span { font-weight: 600; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--action); background: transparent; color: var(--action); font-size: 1.35rem; cursor: pointer; }
.stepper output { font: 700 1.5rem/1 var(--display); min-width: 2.5ch; text-align: center; }
.stepper .hint { flex-basis: 100%; margin: 0; }

.voice { display: grid; gap: .35rem; padding: 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.voice-toggle { display: flex; align-items: center; gap: .7rem; min-height: 44px; font-weight: 600; cursor: pointer; }
.voice input[type="checkbox"] { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; accent-color: var(--action); }
.voice input:disabled { cursor: not-allowed; }
.voice input:disabled + span { color: var(--muted); }
.voice b { margin-left: auto; font: 700 1rem/1 var(--display); }
.voice .hint { margin: 0; }

/* Tu voz: recorder (appears when voice is on). */
.voicebox { display: grid; gap: .6rem; }
.voicebox > .hint { margin: 0; }
.rec { display: grid; gap: .6rem; padding: 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.rec-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.rec-btn { min-height: 48px; }
.rec-time { font: 600 1rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--muted); }
.rec-done { display: grid; gap: .6rem; }
.rec-done audio { width: 100%; min-height: 48px; }
.rec-unsupported { margin: 0; color: var(--muted); }
.rec-status:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; padding: 0; margin: 0 0 .75rem; min-width: 0; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 46px; padding: .6rem 1rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .95rem; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip:has(input:checked) { background: var(--action); border-color: var(--action); color: var(--on-action); }

.field { display: grid; gap: .4rem; margin: 0 0 1.1rem; min-width: 0; }
/* 16px minimum on every input: iOS Safari zooms the page on focus below that. */
.t { width: 100%; min-height: 48px; padding: .75rem .9rem; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; font: 400 16px/1.4 var(--font); }
.t:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-color: transparent; }
[aria-invalid="true"] { border-color: var(--err) !important; }
.phone { display: flex; gap: .5rem; min-width: 0; }
.phone > span { display: grid; place-items: center; padding: 0 .75rem; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--muted); font-weight: 600; background: var(--surface); white-space: nowrap; }
.phone .t { flex: 1; min-width: 0; }

/* File pickers: a real label with a real input, so the native phone picker opens on tap. */
.file { display: grid; gap: .2rem; min-height: 64px; padding: .9rem 1rem; border: 1.5px dashed var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.file-title { font-weight: 700; color: var(--action); }
.file small { color: var(--muted); font-size: .875rem; }
.file-name { font-size: .95rem; color: var(--text); overflow-wrap: anywhere; }
.file-name.none { color: var(--muted); }
[aria-invalid="true"] + .file, .field[data-invalid="true"] .file { border-color: var(--err); }

.err { margin: 0; color: var(--err); font-size: .875rem; }
.err:empty { display: none; }
.chips + .err { margin-top: -.5rem; margin-bottom: .75rem; }
.p, .g { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; font: 600 1rem/1 var(--font); border-radius: 999px; padding: .9rem 1.35rem; cursor: pointer; }
.p { background: var(--action); color: var(--on-action); border: 0; }
.g { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.p:disabled, .g:disabled { opacity: .45; cursor: not-allowed; }
.submit { display: grid; gap: .6rem; justify-items: start; }

/* Formato: two tappable cards side by side, each with a dashed viewfinder in the true frame ratio. */
.orient { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; }
.orient legend { padding: 0; margin: 0 0 .6rem; }
.orient-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
.ocard { position: relative; display: grid; justify-items: center; align-content: start; gap: .3rem; min-height: 44px; padding: .85rem .5rem 1rem; text-align: center; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; min-width: 0; transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.ocard input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ocard:has(input:checked) { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.ocard:has(input:focus-visible) { outline: 3px solid var(--action); outline-offset: 3px; }
.ocard strong { font: 700 .95rem/1.2 var(--display); }
.ocard small { color: var(--muted); font-size: .8125rem; line-height: 1.35; }
/* The viewfinder: a dashed frame with brand corner marks outside it. It settles into a solid frame on select. */
.viewfinder { position: relative; display: block; margin: .45rem 0 .5rem; border: 1.5px dashed var(--muted); border-radius: 3px; transition: transform .35s var(--ease), border-color .35s var(--ease); }
.viewfinder::before { content: ""; position: absolute; inset: -7px; pointer-events: none; --c: var(--sea);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 12px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 2px 12px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 12px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 2px 12px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 12px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 2px 12px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 12px 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 2px 12px no-repeat; }
.viewfinder-v { height: 84px; aspect-ratio: 9 / 16; }
.viewfinder-h { width: 112px; aspect-ratio: 16 / 9; }
.ocard:has(input:checked) .viewfinder { border-style: solid; border-color: var(--action); transform: scale(1.06); }
.orient .err { margin-top: .5rem; }

/* Receipt: single column under the form on a phone; a sticky card on desktop. */
.receipt { display: grid; gap: 1.1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); min-width: 0; }
/* The iris gets its own column on the right. site.css makes .iris absolutely positioned under .motion, so it is reset here. */
.rhead { display: grid; grid-template-columns: minmax(0, 1fr) 56px; align-items: center; gap: .9rem; }
.rhead > div { min-width: 0; }
.rhead h2 { font: 700 1.35rem/1.1 var(--display); margin: 0; }
.rhead .kicker { margin-bottom: .35rem; }
.receipt .rhead .iris { position: relative; inset: auto; grid-column: 2; grid-row: 1; z-index: auto; width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--sea); overflow: visible; }
.receipt .rhead > div:not(.iris) { grid-column: 1; grid-row: 1; }
.receipt .rhead .aperture { position: absolute; inset: 7px; border-radius: 50%; background: var(--sea); clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%); }
.lines { margin: 0; display: grid; gap: 0; border-top: 1px dashed var(--line); }
.lines div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.lines dt { color: var(--muted); flex: none; }
.lines dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
.total strong { font: 700 2.25rem/1 var(--display); }
.total span { color: var(--muted); }

/* Bottom total bar: phones only. Hidden while the keyboard is open (body.kb), so it never sits on the keys. */
.totalbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem max(16px, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: var(--surface); border-top: 1px solid var(--line); }
.totalbar p { margin: 0; display: grid; }
.totalbar strong { font: 700 1.6rem/1 var(--display); }
.totalbar span { font-size: .8125rem; color: var(--muted); }
.totalbar .p { min-width: 44%; }
body.kb .totalbar { display: none; }
body.kb .pide-pill { display: none; }
.order { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }

/* Upload overlay: progress, and retry when the connection drops. */
.upload { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 6; width: min(420px, calc(100vw - 32px)); display: grid; gap: .6rem; padding: 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -18px rgb(0 0 0 / .5); }
.upload progress { width: 100%; height: 12px; accent-color: var(--action); }
.upload p { margin: 0; }

.ok { display: grid; gap: .9rem; padding: 1.5rem 0; max-width: 60ch; }
.ok h2 { font: 700 2rem/1.05 var(--display); margin: 0; }
.ok h2:focus, .ok:focus { outline: none; }

/* Phones: 360 to 412 wide, a little more room between fields as the screen allows. */
@media (min-width: 390px) {
  .durs { gap: .9rem; }
}
@media (min-width: 900px) {
  .order { padding-bottom: 4rem; }
  .order-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 3.5rem; }
  .receipt { position: sticky; top: calc(var(--head) + 1.5rem); }
  .totalbar { display: none; }
  .order-intro h1 { font-size: clamp(3rem, 6vw, 4.25rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
