/* VideoTron — formulario de intake. Oscuro por defecto, claro si el sistema lo prefiere. */
:root {
  --bg: #0b0d17;
  --bg-2: #11142a;
  --card: rgba(22, 26, 48, 0.82);
  --border: rgba(148, 163, 255, 0.16);
  --border-strong: rgba(148, 163, 255, 0.34);
  --text: #e8eaf6;
  --muted: #a3a9c8;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-text: #ffffff;
  --input: rgba(10, 12, 26, 0.7);
  --error: #ff6b81;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 14px;
  --ring: 0 0 0 3px rgba(124, 92, 255, 0.45);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fb;
    --bg-2: #e9ebfa;
    --card: rgba(255, 255, 255, 0.92);
    --border: rgba(60, 64, 120, 0.14);
    --border-strong: rgba(60, 64, 120, 0.3);
    --text: #161a33;
    --muted: #555b7d;
    --accent: #5b3df5;
    --accent-2: #0891b2;
    --input: #ffffff;
    --error: #c81e3a;
    --ok: #047857;
    --warn: #92400e;
    --shadow: 0 20px 50px -25px rgba(30, 30, 80, 0.35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(34, 211, 238, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
}
.wrap { width: min(920px, 100% - 2rem); margin-inline: auto; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; padding: .5rem 1rem; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); z-index: 10; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { padding: 1.25rem 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand-mark { width: 36px; height: 36px; }
.brand-name { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand-name span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.header-tag {
  font-size: .8rem; color: var(--muted); border: 1px solid var(--border);
  padding: .25rem .7rem; border-radius: 999px;
}

.intro { margin: 1.5rem 0 1.5rem; }
.intro h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -0.02em; }
.lead { color: var(--muted); margin: 0; max-width: 60ch; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2rem);
  backdrop-filter: blur(10px);
}

/* Secciones */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.section { padding: 1.25rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.section:first-of-type { padding-top: 0; }
.section > legend {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; padding: 0;
}
.step {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  font-size: .85rem; font-weight: 800; color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.grid { display: grid; gap: 0 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

.field { margin-bottom: 1rem; }
.field.narrow { max-width: 320px; }
.field.sub { margin-top: .25rem; }
label, .label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; padding: 0; }
.req { color: var(--error); }
.optional { color: var(--muted); font-weight: 400; }
.help, .counter { color: var(--muted); font-size: .84rem; margin: .35rem 0 0; }
.field-meta { display: flex; justify-content: space-between; gap: 1rem; }
.error { color: var(--error); font-size: .86rem; margin: .35rem 0 0; min-height: 0; }
.error:empty { display: none; }

input[type="text"], input[type="email"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: .7rem .85rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 3rem; }
select {
  appearance: none; padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
select option { background: var(--bg-2); color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .link-btn:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
[aria-invalid="true"] { border-color: var(--error) !important; }
::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

/* Formato (tarjetas radio) */
.format-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 720px) { .format-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.format-card {
  position: relative; display: grid; justify-items: center; gap: .3rem; text-align: center;
  padding: 1rem .5rem .85rem; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--input); cursor: pointer; font-weight: 600; margin: 0; transition: border-color .15s, transform .15s;
}
.format-card:hover { border-color: var(--accent); }
.format-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.format-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--input)); }
.format-card:has(input:focus-visible) { box-shadow: var(--ring); }
.ratio {
  --u: 2.6rem;
  width: calc(var(--u) * var(--w) / max(var(--w), var(--h)));
  height: calc(var(--u) * var(--h) / max(var(--w), var(--h)));
  border: 2px solid currentColor; border-radius: 5px; opacity: .8; margin-bottom: .25rem;
}
.format-card:has(input:checked) .ratio { color: var(--accent-2); opacity: 1; }
.format-name { font-size: .92rem; }
.format-hint { font-size: .76rem; color: var(--muted); font-weight: 400; }

/* Chips (checkbox) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; margin: 0; font-weight: 500; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--input); transition: all .15s;
}
.chip span::before { content: "+"; font-weight: 700; color: var(--muted); }
.chip input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--input)); }
.chip input:checked + span::before { content: "✓"; color: var(--accent-2); }
.chip input:focus-visible + span { box-shadow: var(--ring); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.5rem 1rem;
  text-align: center; background: var(--input); transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--input)); }
.dropzone p { margin: .25rem 0; }
.dz-icon { width: 34px; height: 34px; color: var(--accent-2); }
.link-btn {
  display: inline; font-weight: 700; color: var(--accent-2); cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; margin: 0; border-radius: 4px;
}
.dropzone:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.previews { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.previews li {
  position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--input);
}
.previews img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.previews .meta { font-size: .74rem; padding: .35rem .5rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.previews .remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1;
}
.previews li.state-ok::after, .previews li.state-error::after {
  position: absolute; left: 6px; top: 6px; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; font-weight: 700;
}
.previews li.state-ok::after { content: "Subida"; background: var(--ok); color: #04210f; }
.previews li.state-error::after { content: "Error"; background: var(--error); color: #fff; }

/* Acciones */
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding-top: 1.5rem; flex-wrap: wrap; }
.status { margin: 0; color: var(--muted); font-size: .92rem; flex: 1 1 200px; }
.btn-primary {
  position: relative; display: inline-flex; align-items: center; gap: .6rem; justify-content: center;
  font: inherit; font-weight: 700; color: var(--accent-text); cursor: pointer;
  padding: .85rem 1.6rem; border: 0; border-radius: 999px; min-height: 48px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 70%, var(--accent)));
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .15s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary[disabled] { cursor: progress; filter: saturate(.6) brightness(.9); transform: none; }
.btn-ghost {
  font: inherit; color: var(--text); background: transparent; border: 1px solid var(--border-strong);
  border-radius: 999px; padding: .35rem .8rem; cursor: pointer;
}
.btn-ghost.small { font-size: .8rem; }
.spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alertas */
.alert { border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1rem; border: 1px solid; }
.alert-error { color: var(--error); border-color: color-mix(in srgb, var(--error) 50%, transparent); background: color-mix(in srgb, var(--error) 10%, transparent); }
.alert-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }

/* Éxito */
.success { text-align: center; }
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 2rem; font-weight: 800; color: #04210f; background: var(--ok);
}
.success h2 { margin: 0 0 .5rem; font-size: 1.6rem; }
.success-meta { display: grid; gap: .75rem; justify-content: center; margin: 1.25rem 0; }
.success-meta div { display: flex; gap: .75rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.success-meta dt { color: var(--muted); }
.success-meta dd { margin: 0; display: flex; align-items: center; gap: .5rem; }
.success-meta code {
  font-size: 1.05rem; padding: .3rem .6rem; border-radius: 8px; background: var(--input); border: 1px solid var(--border-strong);
}
.badge { padding: .2rem .7rem; border-radius: 999px; font-weight: 700; font-size: .85rem; background: color-mix(in srgb, var(--accent-2) 20%, transparent); color: var(--accent-2); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { color: var(--muted); font-size: .82rem; text-align: center; padding: 2rem 0 2.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
.field.sub > .help { margin: -.15rem 0 .6rem; }
.prod-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
