:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #111a33;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.085);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-strong: rgba(255, 255, 255, 0.2);
  --text: #eef2ff;
  --muted: #a8b3cf;
  --accent: #7c9cff;
  --accent-2: #5eead4;
  --danger: #ff9b9b;
  --danger-bg: rgba(255, 90, 90, 0.12);
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 8% -12%, #1c2a5a 0%, transparent 60%),
    radial-gradient(1000px 700px at 112% 8%, #113c4a 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

::selection {
  background: rgba(124, 156, 255, 0.35);
}

/* ---------- Ingreso ---------- */

.gate-body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.gate-card {
  width: min(100%, 460px);
  padding: 34px 30px 26px;
  border: 1px solid var(--stroke);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  border: 1px solid rgba(124, 156, 255, 0.45);
  border-radius: 18px;
  color: #dce6ff;
  background:
    radial-gradient(90px 70px at 20% 0%, rgba(94, 234, 212, 0.28), transparent 70%),
    linear-gradient(145deg, rgba(124, 156, 255, 0.35), rgba(94, 234, 212, 0.12));
  box-shadow: 0 12px 30px rgba(80, 120, 255, 0.22);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 34px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 12px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 14px;
  line-height: 1.45;
}

.gate-form {
  display: grid;
  gap: 9px;
}

.gate-form label {
  margin-top: 6px;
  color: #dbe3ff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.gate-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(4, 9, 24, 0.55);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gate-form input::placeholder {
  color: #6f7c9e;
}

.gate-form input:focus {
  border-color: rgba(124, 156, 255, 0.8);
  background: rgba(4, 9, 24, 0.8);
  box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.16);
}

.btn-primary {
  margin-top: 14px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  color: #071022;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: linear-gradient(135deg, #a9bcff, #5eead4);
  box-shadow: 0 12px 26px rgba(90, 160, 255, 0.24);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-home {
  display: block;
  text-align: center;
  text-decoration: none;
}

.footnote {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.copyright {
  margin: 18px 0 0;
  color: #6f7c9e;
  font-size: 11.5px;
}

/* ---------- Aula ---------- */

.room-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #050817;
}

.room-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 14, 30, 0.92);
  backdrop-filter: blur(14px);
}

.room-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.room-brand strong {
  overflow: hidden;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #5eead4;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

.bar-tag {
  padding-left: 10px;
  border-left: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.room-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.room-user {
  overflow: hidden;
  max-width: 34vw;
  color: #c8d3ee;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-link {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  color: #dbe3ff;
  font-size: 12px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.04);
}

.leave-link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.room-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
}

.room-main iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ---------- OBS ---------- */

.obs-body {
  overflow: hidden;
  background: #000;
}

.obs-body iframe {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ---------- Panel del docente ---------- */

.admin-body {
  padding: 30px 22px 40px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto 22px;
}

.admin-header h1 {
  margin: 2px 0 0;
  font-size: clamp(26px, 4vw, 38px);
}

.eyebrow {
  margin: 0;
  color: #8ea0c9;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 999px;
  color: #9ff5e7;
  font-size: 12px;
  font-weight: 700;
  background: rgba(94, 234, 212, 0.08);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.card {
  padding: 20px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
}

.card-highlight {
  border-color: rgba(124, 156, 255, 0.35);
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(124, 156, 255, 0.16), transparent 70%),
    var(--card-strong);
}

.card-wide {
  grid-column: 1 / -1;
}

.date-line {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.password-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.password {
  display: inline-block;
  padding: 10px 13px;
  border: 1px solid rgba(124, 156, 255, 0.35);
  border-radius: 11px;
  color: #eaf0ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.015em;
  background: rgba(4, 9, 24, 0.55);
}

.password-small {
  padding: 7px 10px;
  font-size: 16px;
}

.btn-small {
  padding: 9px 12px;
  border: 1px solid var(--stroke-strong);
  border-radius: 9px;
  color: #dbe3ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.1);
}

.muted {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.invite-text {
  display: block;
  width: 100%;
  min-height: 96px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid var(--stroke-strong);
  border-radius: 11px;
  color: #e9eeff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  background: rgba(4, 9, 24, 0.55);
}

.btn-inline {
  width: auto;
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 13px;
}

.link-box {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: #cfe0ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  background: rgba(4, 9, 24, 0.45);
}

.link-box:hover {
  border-color: rgba(124, 156, 255, 0.5);
  text-decoration: none;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  text-decoration: none;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.logout-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.logout-link:hover {
  color: #ffb4b4;
  text-decoration: underline;
}

.admin-name {
  margin-top: 4px;
}

.steps {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #dbe3ff;
  font-size: 13px;
  line-height: 1.7;
}

.steps li::marker {
  color: var(--accent-2);
  font-weight: 700;
}

.admin-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: 1120px;
  margin: 24px auto 0;
  color: #6f7c9e;
  font-size: 11.5px;
}

@media (max-width: 600px) {
  .gate-card {
    padding: 28px 22px 22px;
    border-radius: 22px;
  }

  .room-bar {
    min-height: 48px;
    padding: 0 12px;
  }

  .room-user {
    display: none;
  }

  .bar-tag {
    display: none;
  }

  .admin-body {
    padding: 22px 14px 30px;
  }

  .admin-header {
    flex-direction: column;
    gap: 10px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .card-wide {
    grid-column: auto;
  }

  .admin-footer {
    flex-direction: column;
    gap: 6px;
  }

  .password {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.estados-list { display: grid; gap: 8px; margin-top: 14px; }
.estado-item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 12px 14px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; background: rgba(255,255,255,.03); }
.estado-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.estado-name { font-weight: 600; color: var(--text, #eef2ff); }
.estado-pill { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.estado-pill.diseno { color: #aab4cc; border-color: rgba(170,180,204,.35); background: rgba(170,180,204,.08); }
.estado-pill.preparacion { color: #f2c94c; border-color: rgba(242,201,76,.45); background: rgba(242,201,76,.10); }
.estado-pill.publicado { color: #5eead4; border-color: rgba(94,234,212,.4); background: rgba(94,234,212,.08); }
.estado-ctrl { display: flex; align-items: center; gap: 8px; }
.estado-ctrl select { background: rgba(255,255,255,.04); color: var(--text, #eef2ff); border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; min-width: 170px; }
.estado-aviso { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 13px; }
.estado-aviso.ok { color: #5eead4; background: rgba(94,234,212,.08); border: 1px solid rgba(94,234,212,.3); }
.estado-aviso.err { color: #ff8f8f; background: rgba(255,143,143,.08); border: 1px solid rgba(255,143,143,.3); }
@media (max-width: 560px) { .estado-ctrl { width: 100%; } .estado-ctrl select { flex: 1; min-width: 0; } }

/* Mensajes del sitio en el panel docente */
.mensajes-list { display: grid; gap: 10px; margin-top: 14px; }
.mensaje-item { padding: 12px 14px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; background: rgba(255,255,255,.03); }
.mensaje-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.mensaje-tipo { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5eead4; }
.mensaje-fecha { font-size: 12px; color: var(--muted, #a8b3cf); }
.mensaje-meta { margin-top: 4px; font-size: 13px; color: var(--muted, #a8b3cf); }
.mensaje-meta a { color: var(--text, #eef2ff); }
.mensaje-texto { margin: 6px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }

/* ---------------- Ingreso, registro y estado ---------------- */
.auth-links { margin: 18px 0 6px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-links a { color: var(--accent-2); font-weight: 600; }
.field-hint { margin: 7px 2px 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.ok-note { margin: 0 0 16px; padding: 10px 13px; border-radius: 12px; font-size: 14px; color: var(--accent-2); background: rgba(94, 234, 212, 0.08); border: 1px solid rgba(94, 234, 212, 0.3); }

/* ---------------- Matrículas (panel) ---------------- */
.mat-resumen { margin: 4px 0 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.mat-alta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mat-alta input { flex: 1 1 160px; min-width: 0; background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--stroke); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 14px; }
.matriculas-list { display: grid; gap: 10px; }
.mat-item { padding: 13px 15px; border: 1px solid var(--stroke); border-radius: 14px; background: rgba(255,255,255,.03); }
.mat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.mat-pseudo { font-weight: 700; font-size: 15px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fin-pill { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.fin-pill.vigente { color: #5eead4; border-color: rgba(94,234,212,.4); background: rgba(94,234,212,.08); }
.fin-pill.moroso { color: #f2c94c; border-color: rgba(242,201,76,.45); background: rgba(242,201,76,.10); }
.fin-pill.suspendido { color: #ff9b9b; border-color: rgba(255,155,155,.4); background: rgba(255,90,90,.10); }
.fin-pill.pendiente { color: #aab4cc; border-color: rgba(170,180,204,.35); background: rgba(170,180,204,.08); }
.fin-pill.invitado { color: #8ec5ff; border-color: rgba(142,197,255,.45); background: rgba(142,197,255,.10); }
.mat-manual { font-size: 11px; color: var(--muted); }
.mat-manual.off { color: var(--danger); }
.mat-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 10px; font-size: 12.5px; color: var(--muted); }
.mat-meta strong { color: var(--text); font-weight: 600; }
.mat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mat-actions form { margin: 0; }
.mat-reset summary { cursor: pointer; font-size: 12.5px; color: var(--accent); padding: 6px 2px; }
.mat-reset form { display: flex; gap: 6px; margin-top: 6px; }
.mat-reset input { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--stroke); border-radius: 9px; padding: 7px 9px; font: inherit; font-size: 13px; min-width: 140px; }
.btn-small.danger { color: var(--danger); border-color: rgba(255,155,155,.35); background: rgba(255,90,90,.08); }
.btn-small.ok { color: var(--accent-2); border-color: rgba(94,234,212,.35); background: rgba(94,234,212,.08); }

/* Sala de regularización financiera: dos opciones de pago */
.pago-titulo { margin: 18px 0 0; }
.pago-opciones { display: grid; gap: 12px; margin: 10px 0 4px; text-align: left; }
.pago-opcion { border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; padding: 14px 16px; background: rgba(255,255,255,.03); }
.pago-opcion h2 { font-size: 15px; line-height: 1.3; margin: 0 0 6px; }
.pago-opcion p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: var(--muted, #a8b3cf); }
.pago-opcion .pago-precio { font-size: 15px; font-weight: 700; color: var(--text, #eef2ff); }
.pago-opcion form { margin: 0; }
.pago-opcion .btn-primary, .pago-opcion .btn-small { width: 100%; }
.pago-nota { font-size: 12.5px; margin: 12px 0 0; }
