/* =========================================================
   LatinAd · Calculadora de CPM programático (responsive)
   ========================================================= */
:root {
  --navy-950: #030624; --navy-900: #060b36; --navy-800: #0a1255;
  --royal: #1f2fe0; --blue: #2f63ff; --latinad: #2196f3; --sky: #5fb8ff; --cyan: #7fe3ff;
  --ink-2: rgba(226, 234, 255, .8); --ink-3: rgba(200, 214, 255, .56);
  --line: rgba(140, 170, 255, .18); --line-2: rgba(140, 170, 255, .34);
  --ok: #40e0a0; --danger: #ff5b73;
  --f-display: 'Montserrat', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Poppins', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--navy-950); }
body { min-height: 100svh; color: #fff; font-family: var(--f-body); -webkit-font-smoothing: antialiased; background: var(--navy-950); overflow-x: hidden; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.grad { background: linear-gradient(100deg, var(--sky), var(--cyan) 60%, #b69cff); -webkit-background-clip: text; background-clip: text; color: transparent; }

.cc-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 100% -10%, rgba(33, 150, 243, .42), transparent 60%),
    radial-gradient(800px 480px at -10% 110%, rgba(31, 47, 224, .38), transparent 60%),
    linear-gradient(160deg, var(--navy-900), var(--navy-950) 70%); }
.cc-bg::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 20%, #000, transparent 75%); }

.cc-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Encabezado */
.cc-top { position: sticky; top: 0; z-index: 10; background: rgba(3, 6, 36, .7); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.cc-top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 70px; }
.cc-brand img { height: 26px; width: auto; }
.cc-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); transition: color .2s, border-color .2s; }
.cc-chip:hover { color: #fff; border-color: var(--cyan); }
.cc-chip .ico { width: 15px; height: 15px; }

/* Portada */
.cc-hero { padding: clamp(32px, 6vw, 56px) 0 clamp(22px, 4vw, 34px); max-width: 760px; }
.cc-kicker { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--sky); }
.cc-kicker::before { content: ''; width: 10px; height: 10px; background: var(--latinad); box-shadow: 0 0 12px var(--latinad); }
.cc-hero h1 { margin-top: 16px; font: 800 clamp(30px, 5vw, 50px)/1.08 var(--f-display); letter-spacing: -.02em; }
.cc-hero p { margin-top: 14px; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.6; color: var(--ink-2); }

/* Grilla */
.cc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 2.5vw, 28px); align-items: start; padding-bottom: 48px; }
@media (max-width: 900px) { .cc-grid { grid-template-columns: minmax(0, 1fr); } }

.cc-card { background: linear-gradient(160deg, rgba(31, 60, 200, .26), rgba(8, 14, 70, .55)); border: 1px solid var(--line-2); border-radius: 20px; backdrop-filter: blur(12px); box-shadow: 0 30px 80px -40px rgba(0, 0, 20, .9); }

/* Formulario */
.cc-form { padding: clamp(20px, 3vw, 30px); }
.cc-form h2 { font: 700 19px/1.2 var(--f-display); margin-bottom: 22px; }
.cc-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; min-width: 0; }
.cc-field label { font-size: 13.5px; color: var(--ink-2); }
.cc-field label em { font-style: normal; color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.cc-field small { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.cc-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.cc-row2 .cc-field label { min-height: 2.6em; display: flex; align-items: flex-end; }
@media (max-width: 480px) { .cc-row2 { grid-template-columns: minmax(0, 1fr); } .cc-row2 .cc-field label { min-height: 0; } }

.cc-form input, .cc-form select {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; font-size: 15px; outline: none;
  background: rgba(3, 7, 40, .55); border: 1px solid var(--line-2); color: #fff; transition: border-color .15s, box-shadow .15s, background .15s;
}
.cc-form input::placeholder { color: rgba(200, 214, 255, .35); }
.cc-form input:focus, .cc-form select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(127, 227, 255, .18); background: rgba(3, 7, 40, .8); }
.cc-form select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 21px) 21px, calc(100% - 16px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.cc-form select option { background: var(--navy-800); color: #fff; }
.cc-affix { position: relative; }
.cc-affix input { padding-right: 74px; }
.cc-affix span { position: absolute; right: 14px; top: 50%; translate: 0 -50%; font: 600 12px/1 var(--f-mono); letter-spacing: .06em; color: var(--ink-3); pointer-events: none; }

.cc-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(3, 7, 40, .55); border: 1px solid var(--line-2); }
.cc-seg.full { display: flex; }
.cc-seg.full button { flex: 1; }
.cc-seg button { padding: 9px 12px; border-radius: 9px; font-size: 13px; color: var(--ink-2); transition: background .2s, color .2s; white-space: nowrap; }
.cc-seg button.on { background: linear-gradient(135deg, var(--blue), var(--latinad)); color: #fff; box-shadow: 0 6px 18px -8px rgba(33, 150, 243, .8); }
.cc-aud { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
@media (max-width: 420px) { .cc-aud { grid-template-columns: minmax(0, 1fr); } .cc-aud .cc-seg { display: flex; } .cc-aud .cc-seg button { flex: 1; } }

.cc-divider { height: 1px; background: var(--line); margin: 6px 0 20px; }
.cc-error { margin-bottom: 14px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; color: #ffd0d7; background: rgba(255, 91, 115, .12); border: 1px solid rgba(255, 91, 115, .45); }
.cc-error[hidden] { display: none; }
.cc-cta { width: 100%; height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 14px; font: 700 16px/1 var(--f-display); color: #fff; background: linear-gradient(135deg, var(--blue), var(--latinad)); box-shadow: 0 16px 40px -14px rgba(33, 150, 243, .9); transition: transform .2s var(--ease), filter .2s; }
.cc-cta:hover { transform: translateY(-2px); filter: brightness(1.08); }
.cc-cta:disabled { opacity: .7; cursor: progress; transform: none; }

/* Resultado */
.cc-res { min-width: 0; }
.cc-empty { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px 24px; border-radius: 20px; border: 1px dashed var(--line-2); background: rgba(10, 18, 85, .25); }
.cc-empty[hidden], .cc-out[hidden] { display: none; }
.cc-empty-mark { width: 92px; height: 92px; border-radius: 26px; display: grid; place-items: center; background: rgba(33, 150, 243, .14); border: 1px solid rgba(33, 150, 243, .45); }
.cc-empty-mark svg { width: 48px; height: 48px; fill: var(--latinad); }
.cc-empty h2 { font: 700 20px/1.25 var(--f-display); }
.cc-empty p { color: var(--ink-3); font-size: 14px; }

.cc-out { display: flex; flex-direction: column; gap: 14px; }
.cc-out.in > * { animation: ccIn .6s var(--ease) both; }
.cc-out.in > :nth-child(2) { animation-delay: .08s; } .cc-out.in > :nth-child(3) { animation-delay: .16s; }
@keyframes ccIn { from { opacity: 0; transform: translateY(14px); } }
.cc-out .lbl { font: 600 11.5px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sky); }
.cc-hero-metric { padding: 26px 28px; background: linear-gradient(135deg, rgba(47, 99, 255, .55), rgba(33, 150, 243, .3) 55%, rgba(8, 14, 70, .6)); border-color: rgba(127, 227, 255, .45); box-shadow: 0 30px 80px -30px rgba(33, 150, 243, .7); }
.cc-hero-metric .big { display: block; margin: 10px 0 6px; font: 900 clamp(40px, 6vw, 60px)/1 var(--f-display); letter-spacing: -.02em; }
.cc-hero-metric .sub { font-size: 13px; color: var(--ink-2); }
.cc-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .cc-kpis { grid-template-columns: minmax(0, 1fr); } }
.cc-kpi { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.cc-kpi b { font: 800 22px/1.1 var(--f-display); overflow-wrap: anywhere; }
.cc-kpi small { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.cc-compare { padding: 22px 22px 24px; }
.cc-compare h3 { font: 700 16px/1 var(--f-display); margin-bottom: 18px; }
.cc-bar { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.cc-bar[hidden] { display: none; }
.cc-bar .l { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.cc-bar .t { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.cc-bar .t i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .9s var(--ease); }
.cc-bar .t i.trad { background: linear-gradient(90deg, #8b93b5, #c6cbe0); }
.cc-bar .t i.pd { background: linear-gradient(90deg, var(--latinad), var(--cyan)); }
.cc-bar .v { font: 600 13px/1 var(--f-mono); white-space: nowrap; }
@media (max-width: 520px) { .cc-bar { grid-template-columns: minmax(0, 1fr) auto; } .cc-bar .t { grid-column: 1 / -1; grid-row: 2; } }
.cc-verdict { display: flex; align-items: center; gap: 14px; margin-top: 6px; padding: 14px 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.cc-verdict[hidden] { display: none; }
.cc-verdict b { font: 800 22px/1 var(--f-display); white-space: nowrap; }
.cc-verdict.up { background: rgba(64, 224, 160, .12); border: 1px solid rgba(64, 224, 160, .45); }
.cc-verdict.up b { color: var(--ok); }
.cc-verdict.down { background: rgba(255, 91, 115, .1); border: 1px solid rgba(255, 91, 115, .45); }
.cc-verdict.down b { color: var(--danger); }
.cc-hint { font-size: 13px; color: var(--ink-3); }
.cc-hint[hidden] { display: none; }

/* Pie */
.cc-foot { margin-top: auto; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: 12.5px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { .cc-out.in > * { animation: none; } .cc-bar .t i { transition: none; } }
