:root {
  --bg: #060b14;
  --bg-deep: #04070d;
  --panel: rgba(16, 28, 46, 0.62);
  --panel-solid: #0e1a2c;
  --border: rgba(127, 201, 245, 0.16);
  --border-strong: rgba(127, 201, 245, 0.32);
  --ink: #e4eefb;
  --muted: #90a8c6;
  --gold: #f1d68a;
  --gold-deep: #c69a44;
  --ice: #8fd2ff;
  --ice-bright: #c4ecff;
  --ice-deep: #4a90c2;
  --ok: #5ee6a0;
  --off: #f87171;
  --radius: 14px;
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Spectral", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  position: relative;
}

/* Fondo glacial en capas: aurora fría arriba, viñeta azul, grano de escarcha */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 520px at 50% -180px, rgba(78, 150, 210, 0.35), rgba(78, 150, 210, 0) 62%),
    radial-gradient(900px 600px at 85% 8%, rgba(120, 90, 200, 0.14), rgba(0, 0, 0, 0) 60%),
    radial-gradient(800px 700px at 10% 20%, rgba(60, 120, 180, 0.16), rgba(0, 0, 0, 0) 55%),
    linear-gradient(180deg, #081222 0%, var(--bg) 40%, var(--bg-deep) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(115deg, rgba(143, 210, 255, 0.05) 1px, transparent 1px),
    linear-gradient(245deg, rgba(143, 210, 255, 0.04) 1px, transparent 1px);
  background-size: 26px 26px, 34px 34px;
  mask-image: radial-gradient(1200px 700px at 50% 0%, #000 0%, transparent 80%);
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

a { color: var(--ice); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--ice-bright); text-decoration: none; }

code {
  background: rgba(6, 14, 24, 0.85);
  border: 1px solid var(--border-strong);
  padding: .12em .45em;
  border-radius: 6px;
  color: var(--gold);
  font-family: "Consolas", ui-monospace, monospace;
  font-size: .92em;
}

h1, h2, h3, .brand-text {
  font-family: var(--font-display);
  letter-spacing: .5px;
  font-weight: 700;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(8, 16, 28, 0.92), rgba(8, 16, 28, 0.72));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(143, 210, 255, 0.12), 0 8px 30px rgba(0, 0, 0, 0.4);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 46px; filter: drop-shadow(0 2px 10px rgba(143, 210, 255, 0.35)); }
.nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-family: var(--font-display); font-size: .96rem; font-weight: 600; }
.nav a:hover { color: var(--ice-bright); text-shadow: 0 0 12px rgba(143, 210, 255, 0.5); }
.inline { display: inline; margin: 0; }
.link-btn { background: none; border: none; color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: .96rem; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--ice-bright); }

.main { flex: 1; padding: 30px 16px 70px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .98rem;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, filter .2s ease;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(30, 52, 78, 0.7), rgba(16, 30, 48, 0.7));
  color: var(--ice-bright);
  backdrop-filter: blur(4px);
}
.btn:hover { filter: brightness(1.12); box-shadow: 0 0 20px rgba(143, 210, 255, 0.28); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 28px; font-size: 1.08rem; }
.btn-gold {
  background: linear-gradient(180deg, #fbe6b0 0%, var(--gold) 45%, var(--gold-deep) 100%);
  border-color: #e9c877;
  color: #2a1e05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 18px rgba(198, 154, 68, 0.28);
}
.btn-gold:hover { color: #1c1403; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 26px rgba(241, 214, 138, 0.5); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 46px 0 26px; position: relative; }
.hero-glow {
  position: absolute; inset: -40px 0 auto 0; height: 320px; z-index: -1;
  background: radial-gradient(60% 100% at 50% 30%, rgba(143, 210, 255, 0.28), rgba(143, 210, 255, 0) 70%);
  filter: blur(6px);
}
.hero-logo {
  max-width: 620px; width: 92%; margin: 0 auto 6px; display: block;
  filter: drop-shadow(0 6px 26px rgba(74, 144, 194, 0.55)) drop-shadow(0 0 40px rgba(143, 210, 255, 0.25));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.hero-tag {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 3px;
  font-size: .82rem; color: var(--ice); margin: 6px 0 4px;
}
.lead { color: var(--muted); font-size: 1.2rem; max-width: 660px; margin: 0 auto; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 26px 0 16px; }
.status-line { color: var(--muted); margin-top: 12px; font-size: .98rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot-off { background: var(--off); box-shadow: 0 0 10px rgba(248,113,113,.6); }

/* ---------- Tarjetas de cristal helado ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 40px 0; }
.card, .panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(196, 236, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
/* Filo helado superior */
.card::before, .panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 236, 255, 0.6), transparent);
}
.card h3 { margin: 0 0 8px; color: var(--gold); font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); }

.panel { margin: 20px 0; }
.panel h1, .panel h2 { margin-top: 0; }
.panel h1 { font-size: 1.7rem; }
.panel h2 { color: var(--gold); font-size: 1.3rem; }

/* Encabezado de sección con adorno */
h2.section-title { text-align: center; color: var(--gold); }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table thead th {
  color: var(--ice); font-family: var(--font-display); font-size: .82rem;
  text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-strong);
}
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(143, 210, 255, 0.06); }

/* ---------- Formularios ---------- */
.form-wrap { max-width: 470px; margin: 26px auto; }
.form-wrap.center { text-align: center; }
.form-wrap h1 { font-size: 1.7rem; color: var(--gold); text-align: center; }
.form { display: flex; flex-direction: column; gap: 15px; margin-top: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(196, 236, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.35); }
.form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-display); font-size: .92rem; color: var(--ink); }
.form input {
  padding: 12px 13px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: rgba(6, 14, 24, 0.7); color: var(--ink); font-family: var(--font-body); font-size: 1rem;
}
.form input:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px rgba(143, 210, 255, 0.18); }
.form small { color: var(--muted); font-family: var(--font-body); font-weight: 400; }
.muted { color: var(--muted); }

/* ---------- Flash ---------- */
.flash { padding: 13px 15px; border-radius: 11px; margin: 0 0 18px; border: 1px solid; font-weight: 500;
  backdrop-filter: blur(6px); }
.flash-success { background: rgba(94, 230, 160, 0.1); border-color: rgba(94, 230, 160, 0.4); color: #b9f6d6; }
.flash-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); color: #fecaca; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; padding: 22px 0;
  background: linear-gradient(180deg, rgba(8, 16, 28, 0) 0%, rgba(4, 8, 14, 0.6) 100%); }
.site-footer p { margin: 4px 0; }
.realm-line code { color: var(--gold); }

@media (max-width: 560px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .nav { justify-content: center; }
  .brand { justify-content: center; }
  .hero-logo { width: 96%; }
  .lead { font-size: 1.06rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
}
