:root{
  --bg:#f6f8fc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#3b4a63;
  --line:#e5e7eb;
  --brand:#2563eb;
  --brand2:#1d4ed8;
  --danger:#dc2626;
  --warnbg:#fff5f5;
  --shadow:0 12px 30px rgba(2,6,23,.08);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(37,99,235,.10), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(29,78,216,.08), transparent 55%),
    var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
small{color:var(--muted)}

:focus-visible{
  outline:3px solid rgba(37,99,235,.45);
  outline-offset:3px;
  border-radius:12px;
}

/* =========================
   HEADER
   ========================= */
header{
  position:sticky;
  top:0;
  background:rgba(246,248,252,.9);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  z-index:10;
}

.topbar{
  max-width:1100px;
  margin:auto;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:240px;
}
.brand img{
  width:44px;height:44px;
  object-fit:contain;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line);
}
.brand strong{font-size:16px; letter-spacing:.2px}
.brand span{font-size:12px;color:var(--muted)}

nav{display:flex;gap:10px;flex-wrap:wrap}

/* Botones */
.btn{
  padding:10px 16px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(2,6,23,.04);
  transition:transform .08s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover{border-color:#cbd5e1; transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn.primary{
  background:linear-gradient(180deg,var(--brand),var(--brand2));
  color:#fff;
  border:none;
  box-shadow:0 14px 30px rgba(37,99,235,.22);
}
.btn.ghost{
  background:transparent;
  box-shadow:none;
  border-color:transparent;
  color:var(--muted);
}
.btn.ghost:hover{background:rgba(15,23,42,.04); color:var(--text); transform:none}

/* =========================
   LAYOUT
   ========================= */
.wrap{
  max-width:1100px;
  margin:auto;
  padding:26px 18px 40px;
}

.grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:22px;
  align-items:start;
}
@media(max-width:900px){ .grid{grid-template-columns:1fr} }

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:24px;
}

.kicker{
  font-weight:900;
  color:var(--brand2);
  font-size:12px;
  letter-spacing:.25px;
}

h1{margin:6px 0 10px; font-size:36px; letter-spacing:-.4px}
.subtitle{margin:0 0 16px; color:var(--muted); max-width:62ch; line-height:1.5}

/* =========================
   CÓMO FUNCIONA
   ========================= */
.how{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
  margin:14px 0 18px;
}
@media(max-width:900px){ .how{grid-template-columns:1fr} }

.howItem{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:linear-gradient(180deg,#fff,rgba(255,255,255,.78));
}

.howIcon{
  width:28px;height:28px;
  border-radius:10px;
  background:rgba(37,99,235,.12);
  border:1px solid rgba(37,99,235,.20);
  color:#1e3a8a;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  flex:0 0 auto;
}
.howItem strong{display:block;font-size:13.5px;margin-bottom:2px}
.howItem p{margin:0;color:var(--muted);font-size:12.8px;line-height:1.35}

/* =========================
   ROLES
   ========================= */
.rolesBig{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:10px;
}
@media(max-width:600px){ .rolesBig{grid-template-columns:1fr} }

.roleCard{
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:linear-gradient(180deg,#fff,rgba(255,255,255,.78));
  box-shadow:0 8px 18px rgba(2,6,23,.04);
  transition:transform .10s ease, border-color .15s ease, box-shadow .15s ease;
}
.roleCard:hover{
  transform:translateY(-2px);
  border-color:#cbd5e1;
  box-shadow:0 14px 28px rgba(2,6,23,.08);
}
.roleHead{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:6px;
}
.roleEmoji{
  width:34px;height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,23,42,.04);
  border:1px solid var(--line);
  font-size:16px;
}
.roleTitle{font-weight:900; font-size:14px}
.roleDesc{margin:0;color:var(--muted);font-size:13px;line-height:1.4}

/* =========================
   AVISO
   ========================= */
.alert{
  margin-top:16px;
  background:var(--warnbg);
  border:1px solid rgba(220,38,38,.45);
  border-radius:14px;
  padding:14px;
  font-size:13.5px;
  line-height:1.45;
}
.alert b{color:var(--danger)}
.alert a{color:var(--brand2); font-weight:900; text-decoration:underline}

/* =========================
   CTA (botones grandes)
   ========================= */
.cta2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:18px;
}
@media(max-width:600px){ .cta2{grid-template-columns:1fr} }

.ctaBtn{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:12px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
  transition:transform .08s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  text-align:center;
}
.ctaBtn:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
  box-shadow:0 14px 28px rgba(2,6,23,.07);
}
.ctaBtn:active{transform:translateY(0)}
.ctaBtn.primary{
  background:linear-gradient(180deg,var(--brand),var(--brand2));
  color:#fff;
  border-color:transparent;
  box-shadow:0 14px 30px rgba(37,99,235,.22);
  filter:saturate(1.05);
}
.ctaBtn.outline{
  border-color:rgba(37,99,235,.35);
  background:rgba(37,99,235,.04);
}
.ctaBtn.outline:hover{background:rgba(37,99,235,.08)}

.ctaMain{font-weight:950; letter-spacing:.1px}
.ctaSub{font-size:12.5px; opacity:.85}

/* =========================
   VIDEO
   ========================= */
.videoWrap{
  position:relative;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--line);
  background:#0f172a;
}
.videoWrap iframe{
  width:100%;
  height:500px;
  display:block;
}
@media(min-width:1200px){ .videoWrap iframe{ height:540px } }
@media(max-width:600px){ .videoWrap iframe{ height:420px } }

.soundBtn{
  position:absolute;
  top:12px;
  right:12px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(229,231,235,.9);
  background:rgba(255,255,255,.95);
  font-weight:900;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(2,6,23,.12);
}
.soundBtn:active{transform:translateY(1px)}

/* =========================
   FOOTER
   ========================= */
footer{
  margin-top:26px;
  text-align:center;
  font-size:13px;
  color:var(--muted);
}
footer a{color:var(--brand2);font-weight:900;text-decoration:underline}

/* =========================
   PÁGINAS + FORMULARIOS
   ========================= */
.page{
  max-width:860px;
  margin:0 auto;
}

.form{
  display:grid;
  gap:12px;
  margin-top:12px;
}

.field label{
  display:block;
  font-weight:900;
  font-size:13px;
  margin-bottom:6px;
}

.field input, .field select, .field textarea,
textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  outline:none;
  font-size:14px;
  background:#fff;
  transition:border-color .15s ease, box-shadow .15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus,
textarea:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

.hint{
  color:var(--muted);
  font-size:12.5px;
  line-height:1.4;
  margin-top:6px;
}

/* =========================
   LOGIN
   ========================= */
.loginCard{
  max-width:520px;
  margin:0 auto;
}

.loginLinks{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-top:12px;
  flex-wrap:wrap;
}

.link{
  text-decoration:none !important;
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(37,99,235,.22);
  background:rgba(37,99,235,.06);
  color:var(--brand2);
  font-weight:900;
  font-size:13px;
}
.loginLinks .link:hover{
  background:rgba(37,99,235,.10);
  border-color:rgba(37,99,235,.35);
}

.divider{
  display:flex;
  align-items:center;
  gap:12px;
  margin:14px 0;
  color:var(--muted);
  font-weight:800;
  font-size:12px;
}
.divider::before,
.divider::after{
  content:"";
  height:1px;
  background:var(--line);
  flex:1;
}
.divider span{padding:0 6px}

/* =========================
   SEGURIDAD
   ========================= */
.h2{
  margin:0 0 12px;
  font-size:18px;
  letter-spacing:-.2px;
}

.notice{
  margin-top:14px;
  border:1px solid var(--line);
  background:linear-gradient(180deg,#fff,rgba(255,255,255,.78));
  border-radius:16px;
  padding:14px;
}

.notice ul{
  margin:10px 0 0 18px;
  padding:0;
  color:var(--muted);
  line-height:1.5;
}

.rules{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){ .rules{ grid-template-columns:1fr } }

.rule{
  border:1px solid var(--line);
  background:#fff;
  border-radius:16px;
  padding:14px;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
}
.rule h3{margin:0 0 6px; font-size:14px; font-weight:950}
.rule p{margin:0; color:var(--muted); font-size:13.2px; line-height:1.45}

.emergency{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
  margin-top:10px;
}
@media(max-width:900px){ .emergency{ grid-template-columns:1fr } }

.emItem{
  border:1px solid var(--line);
  background:#fff;
  border-radius:16px;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  box-shadow:0 8px 18px rgba(2,6,23,.04);
}
.emItem strong{font-size:18px; letter-spacing:.3px}
.emItem span{color:var(--muted); font-size:13px}

/* =========================
   ALTAS (registro)
   ========================= */
.formCard{
  max-width:640px;
  margin:0 auto;
}

.twoCols{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media(max-width:700px){ .twoCols{ grid-template-columns:1fr } }

.check{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:linear-gradient(180deg,#fff,rgba(255,255,255,.78));
}
.check input{
  margin-top:3px;
  width:18px;
  height:18px;
}

.bigBtn{
  width:100%;
  padding:14px 16px;
  margin-top:6px;
}

.belowForm{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.linkPill{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(37,99,235,.22);
  background:rgba(37,99,235,.06);
  color:var(--brand2);
  font-weight:900;
  font-size:13px;
}
.linkPill:hover{
  background:rgba(37,99,235,.10);
  border-color:rgba(37,99,235,.35);
}

/* =========================
   MÓVIL: header en 2 filas + ajustes
   ========================= */
@media (max-width: 600px){
  .wrap{ padding:18px 14px 28px; }
  .card{ padding:18px; }

  h1{ font-size:30px; line-height:1.15; }
  .subtitle{ font-size:14.5px; margin-bottom:14px; }

  .topbar{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:12px 14px;
  }

  .brand{
    min-width:0;
    width:100%;
    justify-content:flex-start;
    gap:10px;
  }
  .brand img{ width:38px; height:38px; border-radius:10px; }
  .brand span{ font-size:11px; }

  nav{
    width:100%;
    display:flex;
    justify-content:flex-end;
    gap:10px;
  }
  nav .btn{
    padding:10px 14px;
    font-size:14px;
    white-space:nowrap;
  }
  nav .btn.ghost{
    background:#fff;
    border-color:var(--line);
    box-shadow:0 6px 16px rgba(2,6,23,.04);
    color:var(--text);
  }
  nav .btn.ghost:hover{background:#fff; transform:none}

  .how{ gap:10px; margin:12px 0 14px; }
  .howItem{ padding:10px 12px; }
  .howItem strong{ font-size:13px; }
  .howItem p{ font-size:12.5px; }

  .rolesBig{ gap:10px; }
  .roleCard{ padding:12px; }
  .roleDesc{ font-size:12.8px; }

  .alert{ padding:11px; font-size:13px; }

  .cta2{ gap:10px; }
  .ctaBtn{ padding:13px 14px; }
  .ctaMain{ font-size:14px; }
  .ctaSub{ font-size:12.5px; }
}
