:root {
  --navy: #253D90;
  --deep: #0B1640;
  --ink: #0E1B4D;
  --magenta: #EF0074;
  --sky: #5CBAFF;
  --teal: #2CC4A8;
  --text: #F3F6FF;
  --muted: rgba(225, 233, 255, .72);
  --line: rgba(170, 196, 255, .18);
  --glass: rgba(18, 34, 92, .55);
  --ok: #3DD68C;
  --font: 'Nunito', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 80% at 80% 0%, #1D3285 0%, var(--deep) 55%, #070E2C 100%) fixed;
  display: flex; flex-direction: column; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); letter-spacing: .02em; }
.center { text-align: center; }
button, input { font: inherit; }
[hidden] { display: none !important; }

/* ---------- fondo: el isotipo de la CCC en grande. Cada anillo gira a su ritmo y se desplaza con el
   mouse (o al inclinar el celular); una luz suave sigue el cursor. --mx/--my van de -1 a 1 (assets/app.js). */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; --mx: 0; --my: 0; }
.glow { position: absolute; left: var(--gx, 72%); top: var(--gy, 18%); width: 640px; height: 640px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(92,186,255,.16), rgba(239,0,116,.05) 40%, transparent 65%); transition: left .5s ease-out, top .5s ease-out; }
.iso { position: absolute; aspect-ratio: 1; }
.iso-a { width: min(980px, 120vw); right: max(-300px, -24vw); top: max(-300px, -22vw); }
.iso-b { width: 460px; left: -230px; bottom: -200px; opacity: .45; }
.layer { position: absolute; inset: 0; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); transform: translate(calc(var(--mx) * var(--d)), calc(var(--my) * var(--d))); }
.layer svg { width: 100%; height: 100%; display: block; animation: turn var(--t) linear infinite; }
.l1 { --d: -18px; --t: 120s; opacity: .55; }
.l2 { --d: 34px; --t: 90s; opacity: .5; }
.l2 svg { animation-direction: reverse; }
.l3 { --d: 60px; --t: 60s; opacity: .6; }
.iso-b .layer { --d: 14px; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (hover: none) { .glow { display: none; } }

/* ---------- encabezado */
.top { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; padding: 18px 24px 6px; max-width: 1180px; width: 100%; margin: 0 auto; flex: none; }
/* Logos en blanco sobre el azul, como en las piezas de la CCC */
.logo-ccc { height: 56px; width: auto; display: block; }
.logo-vision { height: 28px; width: auto; display: block; }
.sep { width: 1px; height: 40px; background: rgba(255,255,255,.35); }

/* Todo cabe en una pantalla: el encabezado es fijo y cada vista ocupa el alto que queda. */
main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 12px 24px 16px; display: flex; flex-direction: column; }
.view { display: none; }
.view.on { display: block; flex: 1; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- registro */
#vRegister.on { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; text-transform: uppercase; color: var(--sky); margin: 0 0 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61,214,140,.6); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(61,214,140,0); } 100% { box-shadow: 0 0 0 0 rgba(61,214,140,0); } }
h1 { font-weight: 900; font-size: clamp(48px, 7.4vw, 96px); line-height: .95; margin: 0 0 22px; letter-spacing: -.02em; }
.grad { background: linear-gradient(92deg, var(--magenta) 0%, #B04BFF 45%, var(--sky) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--muted); max-width: 30em; margin: 0 0 28px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); }
.steps li { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: rgba(255,255,255,.03); }
.steps b { color: var(--magenta); margin-right: 6px; }

.card-form {
  background: var(--glass); border: 1px solid rgba(160, 190, 255, .22); border-radius: 26px; padding: 22px 24px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
}
.form-head { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; text-transform: uppercase; color: rgba(200,215,255,.6); padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px dashed rgba(170,196,255,.25); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-weight: 800; font-size: 14px; margin-bottom: 5px; }
.field input {
  width: 100%; padding: 12px 15px; border-radius: 14px; border: 1.5px solid rgba(170,196,255,.25);
  background: rgba(7, 14, 44, .55); color: #fff; font-size: 16px; font-weight: 700; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: rgba(200,215,255,.38); font-weight: 600; }
.field input:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(92,186,255,.18); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--muted); margin: 4px 0 12px; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--magenta); flex: none; }
.err { margin: 0 0 10px; color: #FF8DB9; font-weight: 700; font-size: 14px; }
.err:empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; text-decoration: none;
  font-weight: 900; font-size: 17px; border-radius: 16px; padding: 17px 24px; transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { width: 100%; color: #fff; background: linear-gradient(95deg, var(--magenta), #B0249C 45%, var(--navy)); box-shadow: 0 16px 34px -12px rgba(239,0,116,.65); }
.btn.primary:hover { box-shadow: 0 20px 40px -12px rgba(239,0,116,.85); }
.btn.primary[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { color: #fff; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.25); }
.btn.link { background: none; color: var(--sky); font-size: 15px; padding: 10px 8px; width: 100%; font-weight: 800; }
.btn.primary, .btn.ghost { padding: 15px 22px; }

/* ---------- expidiendo */
#vIssuing.on { display: grid; place-items: center; }
.terminal { width: min(560px, 100%); background: rgba(5, 10, 34, .82); border: 1px solid rgba(92,186,255,.3); border-radius: 20px; padding: 26px 26px 22px; box-shadow: 0 0 80px -20px rgba(92,186,255,.45); font-size: 14px; }
.t-title { margin: 0 0 16px; color: var(--sky); text-transform: uppercase; font-size: 11.5px; letter-spacing: .12em; }
.terminal ol { list-style: none; padding: 0; margin: 0 0 18px; min-height: 150px; }
.terminal li { padding: 5px 0; color: #DCE6FF; display: flex; gap: 10px; animation: rise .3s ease-out; }
.terminal li::before { content: '›'; color: var(--magenta); font-weight: 700; }
.terminal li.done::after { content: 'OK'; margin-left: auto; color: var(--ok); font-weight: 700; }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--magenta), var(--sky), var(--teal)); transition: width .45s ease; }

/* ---------- escarapela */
/* La tarjeta (2:3) toma el alto que dejan el encabezado y los botones (--chrome). */
#vBadge.on {
  --chrome: 190px;
  display: grid; justify-content: center; align-content: center; column-gap: 48px; row-gap: 14px;
  grid-template-columns: auto minmax(0, 360px);
  grid-template-areas: "card eyebrow" "card note" "card actions";
}
#vBadge .eyebrow { grid-area: eyebrow; margin: 0; align-self: end; }
.tilt { grid-area: card; perspective: 1200px; width: min(420px, 88vw, calc((100vh - var(--chrome)) * 2 / 3)); width: min(420px, 88vw, calc((100dvh - var(--chrome)) * 2 / 3)); animation: reveal 1s cubic-bezier(.2,.85,.25,1.15); }
@keyframes reveal { 0% { transform: rotateX(24deg) scale(.88); opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: none; } }
.badge { position: relative; border-radius: 26px; overflow: hidden; transform-style: preserve-3d; transition: transform .25s ease-out; box-shadow: 0 50px 90px -30px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.12); background: var(--ink); aspect-ratio: 2 / 3; }
.badge img { display: block; width: 100%; height: 100%; }
.foil, .glare { position: absolute; inset: 0; pointer-events: none; }
.foil {
  mix-blend-mode: color-dodge; opacity: .22;
  background: linear-gradient(115deg, transparent 20%, #ff4fb0 32%, #ffd84f 40%, #4fffd4 48%, #4f9bff 56%, #c14fff 64%, transparent 78%);
  background-size: 250% 250%; background-position: var(--px, 50%) var(--py, 50%);
}
.glare { background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,.28), transparent 45%); mix-blend-mode: overlay; }
.arch-note { grid-area: note; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.arch-note b { color: #fff; }
.actions { grid-area: actions; align-self: start; display: grid; grid-template-columns: 1fr; gap: 10px; }
#verifyActions { grid-template-columns: 1fr; }
.actions .links { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.actions .links .btn.link { width: auto; padding: 8px 12px; }
.btn.linkedin { color: #fff; background: #0A66C2; box-shadow: 0 16px 34px -12px rgba(10,102,194,.7); padding: 15px 22px; }
.btn.linkedin:hover { background: #0B5BAA; }
.li-ico { width: 20px; height: 20px; flex: none; }
.toast { position: fixed; left: 50%; bottom: 18px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); background: #fff; color: #0E1B4D; font-weight: 800; font-size: 14px; line-height: 1.35; padding: 12px 16px; border-radius: 14px; box-shadow: 0 20px 40px -10px rgba(0,0,0,.5); transition: opacity .25s, transform .25s; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.foot { position: relative; z-index: 1; flex: none; text-align: center; font-size: 11px; color: rgba(200,215,255,.45); padding: 6px 16px 14px; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- foto */
.photo-field { display: flex; gap: 12px; align-items: center; margin: 2px 0 12px; padding: 8px 10px; border-radius: 16px; border: 1.5px dashed rgba(170,196,255,.28); background: rgba(7,14,44,.35); }
.pf-text { flex: 1; min-width: 0; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; padding: 0; cursor: pointer; overflow: hidden; border: 2px solid rgba(92,186,255,.6); background: radial-gradient(circle at 50% 35%, #2B3F95, #101C52); display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(239,0,116,.18); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-ph { font-size: 24px; font-weight: 900; color: var(--sky); line-height: 1; }
.pf-title { display: block; font-weight: 800; font-size: 14px; }
.pf-title em { font-style: normal; font-weight: 700; color: var(--muted); }
.pf-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.pf-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip-btn { border: 1.5px solid rgba(92,186,255,.55); background: rgba(92,186,255,.12); color: #fff; font-weight: 800; font-size: 13px; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.chip-btn.quiet { border-color: rgba(255,255,255,.2); background: none; color: var(--muted); }
.cropper { position: fixed; inset: 0; z-index: 60; background: rgba(3,7,26,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; }
.crop-box { width: min(420px, 100%); background: #0F1C55; border: 1px solid rgba(160,190,255,.25); border-radius: 24px; padding: 22px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.7); }
.crop-title { margin: 0; font-weight: 900; font-size: 20px; }
.crop-sub { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.crop-stage { position: relative; width: min(100%, calc(100dvh - 260px)); margin: 0 auto; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #050B26; touch-action: none; cursor: grab; }
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { width: 100%; height: 100%; display: block; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle closest-side, transparent 0 97%, rgba(5,11,38,.62) 97.5%); }
.crop-ring::after { content: ''; position: absolute; inset: 1.5%; border-radius: 50%; border: 3px solid var(--sky); box-shadow: 0 0 0 3px rgba(239,0,116,.35); }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; font-weight: 900; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--magenta); }
.crop-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.crop-actions .btn { padding: 14px; font-size: 16px; }

/* ---------- celular */
/* Pantallas de poca altura (portátiles): todo un poco más compacto */
@media (min-width: 861px) and (max-height: 800px) {
  .logo-ccc { height: 46px; } .logo-vision { height: 24px; } .sep { height: 34px; }
  h1 { font-size: clamp(44px, 6vw, 80px); margin-bottom: 16px; }
  .lead { margin-bottom: 20px; }
  .form-head { display: none; }
  .top { padding: 12px 24px 2px; }
  main { padding-top: 6px; padding-bottom: 8px; }
  .card-form { padding: 18px 22px; }
  .field { margin-bottom: 10px; }
  #vBadge.on { --chrome: 160px; }
}

@media (max-width: 860px) {
  .top { padding: 12px 16px 2px; gap: 12px; }
  .logo-ccc { height: 40px; } .logo-vision { height: 20px; } .sep { height: 28px; }
  main { padding: 6px 16px 8px; }
  .foot { display: none; }
  /* Registro: solo lo necesario para registrarse */
  #vRegister.on { grid-template-columns: 1fr; gap: 12px; align-content: start; }
  .eyebrow { font-size: 11px; margin-bottom: 6px; }
  h1 { font-size: 36px; margin: 0; }
  .lead, .steps, .form-head, .pf-sub { display: none; }
  .card-form { padding: 14px 16px; border-radius: 20px; }
  .field { margin-bottom: 9px; }
  .field span { font-size: 13px; margin-bottom: 4px; }
  .field input { padding: 10px 14px; }
  .photo-field { margin-bottom: 9px; padding: 6px 8px; }
  .avatar { width: 44px; height: 44px; }
  .consent { font-size: 12px; line-height: 1.35; margin: 2px 0 10px; gap: 10px; }
  .btn.primary, .btn.ghost { padding: 13px 18px; font-size: 16px; }
  .btn.link { padding: 6px; font-size: 14px; }
  /* Escarapela: tarjeta arriba, botones abajo */
  #vBadge.on { --chrome: 215px; grid-template-columns: auto; grid-template-areas: "eyebrow" "card" "actions"; row-gap: 10px; align-content: start; justify-items: center; }
  #vBadge .eyebrow { align-self: auto; }
  .arch-note { display: none; }
  .actions { width: min(420px, 100%); grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  .actions .links { grid-column: 1 / -1; gap: 0; }
  .actions .links .btn.link { padding: 6px 10px; }
  .btn.linkedin { padding: 13px 14px; font-size: 16px; }
  .lg { display: none; }
  .iso-a { width: 150vw; right: -62vw; top: -48vw; }
  .iso-b { width: 340px; left: -190px; bottom: -150px; }
}
/* Celulares bajitos (iPhone SE y similares) */
@media (max-width: 860px) and (max-height: 640px) {
  .eyebrow:not(#badgeEyebrow) { display: none; }
  h1 { font-size: 30px; }
  h1 br { display: none; }
  .field { margin-bottom: 7px; }
  .field span { font-size: 12.5px; margin-bottom: 3px; }
  .field input { padding: 8px 12px; }
  .photo-field { padding: 4px 8px; margin-bottom: 7px; }
  .avatar { width: 38px; height: 38px; }
  .consent { font-size: 11.5px; margin-bottom: 8px; }
  .btn.primary, .btn.ghost { padding: 12px 18px; }
  #vBadge.on { --chrome: 212px; }
}
@media (prefers-reduced-motion: reduce) {
  .layer svg, .dot { animation: none; }
  .layer { transition: none; transform: none; }
  .tilt { animation: none; }
}
