:root{
  --red: #CC0000;
  --red-dark: #970000;
  --red-tint: #F7DEDE;
  --ink: #1A1A1A;
  --paper: #FAFAF9;
  --paper-raised: #FFFFFF;
  --steel: #5B5955;
  --line: #E7E5E2;
  --ok: #2F6B3A;

  --display: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark){
  :root{
    --paper: #121212;
    --paper-raised: #1A1A1A;
    --ink: #F2F1EF;
    --steel: #A8A6A1;
    --line: #2A2A28;
    --red-tint: #3A1414;
  }
}
:root[data-theme="dark"]{
  --paper: #121212;
  --paper-raised: #1A1A1A;
  --ink: #F2F1EF;
  --steel: #A8A6A1;
  --line: #2A2A28;
  --red-tint: #3A1414;
}
:root[data-theme="light"]{
  --paper: #FAFAF9;
  --paper-raised: #FFFFFF;
  --ink: #1A1A1A;
  --steel: #5B5955;
  --line: #E7E5E2;
  --red-tint: #F7DEDE;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img,svg{ max-width:100%; display:block; }
.wrap{ max-width: 1100px; margin: 0 auto; padding: 0 28px; }
a{ color: inherit; }
h1,h2,h3{ text-wrap: balance; margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--red);
  font-weight: 600;
}
.tabular{ font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible{ outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Nav ---------- */
.nav{
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap{
  display:flex; align-items:center; justify-content:space-between;
  height: 76px; gap: 24px;
}
.brand{ display:flex; align-items:center; gap: 12px; text-decoration:none; color: inherit; }
.brand img{ height: 34px; width: auto; }
.brand-name{
  font-family: var(--display); font-weight: 600; font-size: 0.92rem;
  line-height: 1.2; color: var(--ink);
}
.brand-name small{ display:block; color: var(--steel); font-weight: 400; font-size: 0.78rem; }
.nav-links{ display:flex; gap: 32px; list-style:none; margin:0; padding:0; }
.nav-links a{
  text-decoration:none; font-size:0.92rem; font-weight: 500;
  color: var(--steel);
}
.nav-links a:hover{ color: var(--ink); }
.nav-cta{
  background: var(--red); color:#fff; text-decoration:none;
  font-weight:600; font-size:0.88rem; padding: 10px 18px;
  border-radius: 6px;
}
.nav-cta:hover{ background: var(--red-dark); }

/* ---------- Hero ---------- */
.hero{ padding: 96px 0 0; position: relative; overflow: clip; }
.hero-glow{
  position:absolute; top:-220px; right:-180px; width:640px; height:640px;
  background: radial-gradient(circle, color-mix(in srgb, var(--red) 16%, transparent) 0%, transparent 68%);
  pointer-events:none; z-index:0;
}
.hero-route{
  position:absolute; left:-40px; bottom:-30px; width:420px; opacity:0.5;
  pointer-events:none; z-index:0;
}
@media (prefers-color-scheme: dark){ .hero-route{ opacity:0.35; } }
:root[data-theme="dark"] .hero-route{ opacity:0.35; }
.hero .wrap{ display:grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items:center; position:relative; z-index:1; padding-bottom: 72px; }
.hero-eyebrow-row{ display:flex; align-items:center; gap: 10px; }
.hero-eyebrow-row .dot{ width:7px; height:7px; border-radius:50%; background: var(--red); display:inline-block; box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }
.hero h1{
  font-size: clamp(2.3rem, 4vw, 3.5rem);
  margin-top: 16px;
  font-weight: 650;
}
.hero h1 em{ color: var(--red); font-style: normal; position: relative; }
.hero h1 em::after{
  content:""; position:absolute; left:0; right:0; bottom:2px; height:8px;
  background: color-mix(in srgb, var(--red) 20%, transparent); z-index:-1; border-radius: 2px;
}
.hero p{
  max-width: 46ch; color: var(--steel); font-size: 1.08rem; margin-top: 18px;
}
.hero-actions{ display:flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.btn{
  font-weight:600; font-size: 0.92rem; text-decoration:none;
  padding: 13px 22px; display:inline-block; border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary{ background: var(--red); color:#fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--red) 70%, transparent); }
.btn-primary:hover{ background: var(--red-dark); transform: translateY(-1px); }
.btn-ghost{ border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover{ border-color: var(--steel); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce){ .btn{ transition:none; } .btn:hover{ transform:none; } }

.board{
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,0.22);
}
.board-head{
  display:flex; justify-content:space-between; align-items:baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 6px;
}
.board-clock{ font-family: var(--mono); font-weight:600; color: var(--red); font-size: 0.85rem; }
.board-empty{ color: var(--steel); font-size: 0.9rem; padding: 14px 0 2px; }
.board-desvio{ padding: 13px 0; border-bottom: 1px solid var(--line); }
.board-desvio:last-child{ border-bottom:none; }
.board-desvio-top{ display:flex; justify-content:space-between; align-items:baseline; gap: 12px; }
.board-desvio-ramal{ font-weight: 600; font-size: 0.95rem; }
.board-desvio-fecha{ font-family: var(--mono); color: var(--steel); font-size: 0.78rem; white-space:nowrap; }
.board-desvio-text{
  margin: 4px 0 0; color: var(--steel); font-size: 0.86rem; line-height: 1.45;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

.partidos-strip{
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 0; margin-top: 0;
}
.partidos-strip .wrap{ display:flex; gap: 36px; flex-wrap: wrap; justify-content:center; }
.partidos-strip span{
  font-size: 0.88rem; color: var(--steel); font-weight: 500;
}
.partidos-strip span b{ color: var(--ink); font-weight: 600; }

/* ---------- Stats ---------- */
.stats{ padding: 56px 0; }
.stats .wrap{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow:hidden; }
.stat{ background: var(--paper); padding: 26px 24px; text-align:center; }
.stat strong{ display:block; font-family: var(--display); font-size: 2.1rem; font-weight: 650; color: var(--red); font-variant-numeric: tabular-nums; }
.stat span{ display:block; margin-top: 6px; font-size: 0.85rem; color: var(--steel); }

/* ---------- Section shell ---------- */
section{ padding: 88px 0; }
.section-head{ display:flex; justify-content:space-between; align-items:flex-end; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.section-head h2{ font-size: clamp(1.7rem, 2.6vw, 2.15rem); margin-top:8px; }
.section-head p{ color: var(--steel); max-width: 42ch; margin: 6px 0 0; }

.band{ background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Líneas / rutas ---------- */
.routes-grid{ display:grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.route-card{
  background: var(--paper); padding: 28px 30px;
  border-top: 3px solid var(--red);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.route-card:hover{ transform: translateY(-2px); box-shadow: 0 16px 32px -18px rgba(0,0,0,0.25); position:relative; z-index:1; }
@media (prefers-reduced-motion: reduce){ .route-card{ transition:none; } .route-card:hover{ transform:none; } }
.route-num{ font-size: 0.78rem; color: var(--red); font-weight: 700; letter-spacing: 0.06em; }
.route-card h3{ font-family: var(--display); font-size:1.9rem; font-weight: 650; margin-top: 4px; }
.ramales-list{ margin-top: 18px; padding-top: 14px; border-top:1px solid var(--line); }
.ramal-row{
  display:flex; justify-content:space-between; gap:16px;
  padding: 8px 0; font-size: 0.92rem;
}
.ramal-row b{ color: var(--ink); font-weight:600; white-space:nowrap; }
.ramal-row span{ color: var(--steel); text-align:right; }

/* ---------- Paradas ---------- */
.paradas-controls{ display:flex; flex-wrap:wrap; align-items:center; gap: 20px; margin-bottom: 36px; }
.field-inline{ display:flex; align-items:center; gap: 10px; }
.field-inline label{ font-size: 0.85rem; color: var(--steel); font-weight: 500; }
.field-inline select{
  border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink);
  padding: 10px 14px; border-radius: 8px; font: inherit; font-size: 0.92rem; min-width: 240px;
}
.field-inline select:focus{ border-color: var(--red); }

.sentido-toggle{ display:inline-flex; border: 1px solid var(--line); border-radius: 100px; padding: 3px; gap: 2px; }
.sentido-btn{
  border: none; background: none; padding: 8px 18px; border-radius: 100px;
  font-size: 0.85rem; font-weight: 600; color: var(--steel); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sentido-btn.is-active{ background: var(--red); color: #fff; }

.paradas-list{ list-style: none; margin: 0; padding: 0; column-gap: 48px; }
.paradas-list li{
  position: relative; padding: 12px 0 12px 26px; margin-left: 6px;
  border-left: 2px solid var(--line); font-size: 0.95rem; color: var(--ink);
  break-inside: avoid; -webkit-column-break-inside: avoid;
}
.paradas-list li::before{
  content: ""; position: absolute; left: -6px; top: 19px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--paper);
}
.paradas-list li:last-child{ border-left-color: transparent; }

@media (min-width: 640px){
  .paradas-list{ column-count: 2; }
}
@media (min-width: 980px){
  .paradas-list{ column-count: 3; }
}

/* ---------- Filtro de ramales (Desvíos) ---------- */
.ramal-filters{ display:flex; flex-wrap:wrap; align-items:center; gap: 10px; margin-bottom: 32px; }
.ramal-filters-label{ font-size: 0.85rem; color: var(--steel); font-weight: 500; margin-right: 2px; }
.filter-chip{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 8px 14px 8px 10px; border: 1px solid var(--line); border-radius: 100px;
  font-size: 0.88rem; color: var(--ink); background: var(--paper-raised);
  cursor: pointer; user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.filter-chip:hover{ border-color: var(--steel); }
.filter-chip.is-checked{ border-color: var(--red); background: var(--red-tint); color: var(--red-dark); }
.filter-chip input{
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--steel);
  display: grid; place-content: center; cursor: pointer; flex: none;
}
.filter-chip.is-checked input{ border-color: var(--red); }
.filter-chip input::before{
  content: ""; width: 8px; height: 8px; border-radius: 2px;
  background: var(--red); transform: scale(0); transition: transform 0.1s ease;
}
.filter-chip input:checked::before{ transform: scale(1); }
.filter-clear{
  border: none; background: none; color: var(--steel); font-size: 0.85rem;
  font-weight: 500; text-decoration: underline; cursor: pointer; padding: 8px 4px;
}
.filter-clear:hover{ color: var(--ink); }

/* ---------- Noticias ---------- */
.notice-list{ display:flex; flex-direction:column; }
.notice{
  display:grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items:start;
  padding: 26px 20px; margin: 0 -20px; border-bottom: 1px solid var(--line);
  border-radius: 10px; transition: background 0.15s ease;
}
.notice:hover{ background: var(--paper-raised); }
.notice:last-child{ border-bottom:none; }
.notice[hidden]{ display:none; }
.notice-date{ font-family: var(--mono); color: var(--steel); font-size: 0.82rem; padding-top: 3px; }
.notice h3{ font-size: 1.02rem; font-weight:600; margin-bottom: 6px; }
.notice p{ color: var(--steel); margin: 0; font-size: 0.94rem; max-width: 60ch; }
.notice-empty{ color: var(--steel); font-size: 0.95rem; padding: 12px 0; }

/* ---------- Contacto ---------- */
.contact-grid{ display:grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; }
.contact-info h3{ font-size:1.3rem; }
.contact-line{ display:flex; gap:14px; margin-top: 20px; font-size:0.95rem; align-items:flex-start; }
.contact-line svg{ flex: none; width:18px; height:18px; color: var(--red); margin-top:2px; }
.contact-line span{ color: var(--ink); }
.contact-line small{ display:block; color: var(--steel); font-size:0.82rem; margin-top:2px; }
.contact-form{}
.field{ margin-bottom: 20px; }
.field label{
  display:block; font-weight:600; font-size: 0.82rem; color: var(--steel); margin-bottom: 7px;
}
.field input, .field select, .field textarea{
  width:100%; border: 1px solid var(--line); background: var(--paper-raised);
  color: var(--ink); padding: 12px 14px; font: inherit; font-size: 0.95rem; border-radius: 6px;
}
.field textarea{ resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--red); }
.submit-btn{
  background: var(--red); color:#fff; border:none; cursor:pointer;
  font-weight:600; font-size:0.92rem; padding: 13px 24px; border-radius: 6px;
}
.submit-btn:hover{ background: var(--red-dark); }
.form-msg{ padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 20px; }
.form-msg.ok{ background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.form-msg.error{ background: var(--red-tint); color: var(--red-dark); }

/* ---------- Postulación (rrhh) ---------- */
.postular-top{
  border-bottom: 1px solid var(--line); padding: 22px 0; margin-bottom: 48px;
}
.postular-top .wrap{ display:flex; align-items:center; justify-content:space-between; gap: 20px; }
.postular-brand{ display:flex; align-items:center; gap: 12px; text-decoration:none; color: inherit; }
.postular-brand img{ height: 30px; width: auto; }
.postular-brand span{ font-family: var(--display); font-weight: 600; font-size: 0.92rem; }
.postular-volver{ font-size: 0.85rem; color: var(--steel); text-decoration:none; }
.postular-volver:hover{ color: var(--ink); }

.postular-main{ padding-bottom: 88px; }
.postular-main .wrap{ max-width: 640px; }

.steps{ display:flex; margin-bottom: 40px; }
.step{ flex:1; text-align:center; position:relative; font-size: 0.82rem; color: var(--steel); }
.step::before{
  content:""; position:absolute; top:11px; left:-50%; width:100%; height:2px;
  background: var(--line); z-index:0;
}
.step:first-child::before{ content:none; }
.step.is-done::before{ background: var(--red); }
.step-dot{
  position:relative; z-index:1; width:24px; height:24px; border-radius:50%;
  background: var(--paper-raised); border: 2px solid var(--line); color: var(--steel);
  display:flex; align-items:center; justify-content:center; margin: 0 auto 8px;
  font-family: var(--mono); font-size: 0.72rem; font-weight:700;
}
.step.is-done .step-dot, .step.is-active .step-dot{ border-color: var(--red); color: var(--red); }
.step.is-done .step-dot{ background: var(--red); color: #fff; }
.step.is-active{ color: var(--ink); font-weight:600; }

.postular-card{
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 32px; margin-bottom: 24px;
}
.postular-card h2{ font-size: 1.25rem; margin-bottom: 20px; }
.postular-card h3{ font-size: 1rem; margin-bottom: 4px; }
.postular-hint{ color: var(--steel); font-size: 0.85rem; margin-top: 18px; }

.field-row{ display:flex; gap: 16px; flex-wrap: wrap; }
.field-row .field{ flex: 1; min-width: 160px; }

.loaded-list{ display:flex; flex-direction:column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow:hidden; margin-bottom: 24px; }
.loaded-row{ background: var(--paper-raised); padding: 14px 18px; display:flex; justify-content:space-between; gap: 16px; font-size: 0.9rem; }
.loaded-row b{ color: var(--red); font-weight:600; white-space:nowrap; }
.loaded-row span{ color: var(--steel); text-align:right; }

.postular-actions{ display:flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.file-field{ display:flex; align-items:center; gap: 14px; flex-wrap: wrap; }
.file-field .btn{ padding: 10px 16px; cursor:pointer; }
.file-name{ color: var(--steel); font-size: 0.9rem; }
.file-input-oculto{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ---------- Footer ---------- */
footer{ padding: 44px 0; border-top: 1px solid var(--line); }
.footer-row{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap: 16px; font-size:0.85rem; color: var(--steel); }
.footer-row img{ height: 22px; }
.footer-brand{ display:flex; align-items:center; gap: 10px; }

@media (max-width: 880px){
  .hero .wrap{ grid-template-columns: 1fr; }
  .routes-grid{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr; gap: 40px; }
  .nav-links{ display:none; }
  .stats .wrap{ grid-template-columns: 1fr; }
  .notice{ grid-template-columns: 1fr; gap: 8px; margin: 0; }
}
