/* ============================================================
   Geekoders · Portal de Onboarding Comercial — G2407
   Identidad teal/turquesa · tema oscuro premium
   ============================================================ */
:root {
  --bg: #07121c;
  --bg-soft: #0c1c2a;
  --card: #102536;
  --card-2: #0e2030;
  --card-hover: #14324a;
  --line: #1b3850;
  --line-soft: #142b3f;
  --text: #e8f2f6;
  --muted: #93aabb;
  --muted-2: #6f8a9c;
  --primary: #22d3c5;
  --primary-2: #19b8ab;
  --primary-dark: #0e9e90;
  --accent: #38e0a3;
  --accent-2: #36c6f0;
  --gold: #f7b94e;
  --danger: #f87171;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(34, 211, 197, 0.18), 0 18px 50px rgba(8, 30, 36, 0.6);
  --grad-brand: linear-gradient(135deg, #22d3c5 0%, #38e0a3 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(34, 211, 197, 0.16), rgba(56, 224, 163, 0.10));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 620px at 85% -8%, rgba(34, 211, 197, 0.16) 0%, rgba(7, 18, 28, 0) 55%),
    radial-gradient(900px 540px at 5% 8%, rgba(56, 224, 163, 0.10) 0%, rgba(7, 18, 28, 0) 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

h1, h2, h3 { letter-spacing: -0.01em; }

.muted { color: var(--muted); }

::selection { background: rgba(34, 211, 197, 0.3); color: #fff; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 30px;
  background: rgba(8, 20, 30, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-brand);
  color: #03171a; font-weight: 900; font-size: 18px;
  box-shadow: 0 6px 18px rgba(34, 211, 197, 0.35);
}
.brand-mark.big { width: 62px; height: 62px; font-size: 30px; border-radius: 18px; }
.brand-name { font-size: 0.98rem; letter-spacing: 0.2px; }
.brand-name b { color: var(--primary); }
.topnav { display: flex; align-items: center; gap: 20px; }
.topnav a { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.topnav a:hover { color: var(--text); }
.topnav .who {
  color: var(--text); font-size: 0.86rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  background: var(--grad-brand-soft); border: 1px solid rgba(34, 211, 197, 0.22);
}
.inline { display: inline; margin: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 38px 24px 56px; flex: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin-bottom: 36px;
  padding: 34px 34px 32px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(34, 211, 197, 0.18), rgba(7, 18, 28, 0) 60%),
    linear-gradient(180deg, rgba(16, 37, 54, 0.9), rgba(14, 32, 48, 0.7));
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: var(--grad-brand); opacity: 0.12; filter: blur(18px);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 12px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--grad-brand-soft); border: 1px solid rgba(34, 211, 197, 0.22);
}
.hero h1 { margin: 0 0 8px; font-size: 2.05rem; line-height: 1.15; }
.hero h1 .accent { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; max-width: 640px; font-size: 1.02rem; color: var(--muted); }

.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; }
.hero-stat .n { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.hero-stat .n span { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stat .l { font-size: 0.78rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- Quick links row ---------- */
.quicklinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 40px; }
.quicklink {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-weight: 600; font-size: 0.92rem;
  transition: transform .14s, border-color .14s, background .14s;
}
.quicklink:hover { transform: translateY(-3px); border-color: var(--primary); color: var(--text); background: var(--card-hover); }
.quicklink .qi { font-size: 1.4rem; }

/* ---------- Categorías ---------- */
.cat-block { margin-bottom: 44px; }
.cat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.cat-icon {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 50px; height: 50px; border-radius: 14px; font-size: 1.6rem;
  background: var(--grad-brand-soft); border: 1px solid rgba(34, 211, 197, 0.2);
}
.cat-head h2 { margin: 0; font-size: 1.3rem; }
.cat-head p { margin: 3px 0 0; font-size: 0.9rem; }
.cat-count { margin-left: auto; font-size: 0.78rem; color: var(--muted-2); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.doc-card {
  position: relative; display: flex; flex-direction: column; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  color: var(--text); overflow: hidden;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.doc-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-brand); opacity: 0; transition: opacity .15s;
}
.doc-card:hover { border-color: rgba(34, 211, 197, 0.5); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.doc-card:hover::before { opacity: 1; }
.doc-card h3 { margin: 0; font-size: 1.06rem; }
.doc-card p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
.doc-link { margin-top: auto; color: var(--primary); font-size: 0.84rem; font-weight: 700; }
.doc-card:hover .doc-link { color: var(--accent); }

/* ---------- Auth ---------- */
.auth-wrap { flex: 1; display: grid; place-items: center; min-height: 84vh; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 38px 34px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad-brand);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { margin: 0 auto 14px; }
.auth-brand h1 { margin: 0; font-size: 1.5rem; }
.auth-brand .pill { display: inline-block; margin-top: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.auth-brand p { margin: 8px 0 0; font-size: 0.88rem; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 0.78rem; color: var(--muted-2); }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 0.8rem; color: var(--muted); margin-top: 12px; font-weight: 500; }
.form input, .form select {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; color: var(--text); font-size: 0.95rem;
  transition: border-color .15s, box-shadow .15s;
}
.form input::placeholder { color: var(--muted-2); }
.form input:focus, .form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34, 211, 197, 0.15); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; border: none; border-radius: 11px;
  padding: 12px 20px; font-size: 0.92rem; font-weight: 700; color: #fff;
  background: var(--bg-soft); transition: filter .15s, transform .05s, border-color .15s, background .15s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-brand); color: #03171a; box-shadow: 0 8px 22px rgba(34, 211, 197, 0.28); }
.btn-primary:hover { filter: brightness(1.06); color: #03171a; }
.btn-block { width: 100%; margin-top: 20px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--text); }
.btn-mini { padding: 7px 11px; font-size: 0.78rem; border-radius: 9px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); }
.btn-mini:hover { border-color: var(--primary); }

/* ---------- Alertas ---------- */
.alert { border-radius: 11px; padding: 12px 15px; font-size: 0.88rem; margin-bottom: 16px; }
.alert-error { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.5); color: #ffd5d5; }
.alert-ok { background: rgba(56, 224, 163, 0.12); border: 1px solid rgba(56, 224, 163, 0.5); color: #b9f5dd; }

/* ---------- Visibilidad por rol ---------- */
.vis-table td, .vis-table th { vertical-align: middle; }
.vis-table .center, th.center { text-align: center; }
.vis-ico { margin-right: 6px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form input[type="file"] {
  background: var(--bg-soft); border: 1px dashed var(--line); border-radius: 11px;
  padding: 10px 12px; color: var(--muted); font-size: 0.86rem; cursor: pointer;
}
.form input[type="file"]::file-selector-button {
  background: var(--grad-brand); color: #03171a; border: none; border-radius: 8px;
  padding: 7px 12px; margin-right: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* ---------- Lista de archivos (admin) ---------- */
.files-group { margin-bottom: 18px; }
.files-group-title { font-size: 0.95rem; margin: 8px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.file-ico { font-size: 1.3rem; flex: 0 0 auto; }
.file-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-meta a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta .muted { font-size: 0.76rem; }

/* ---------- Tarjeta de archivo (dashboard) ---------- */
.file-card .file-badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 0.72rem; font-weight: 700; color: var(--primary);
  padding: 3px 10px; border-radius: 999px;
  background: var(--grad-brand-soft); border: 1px solid rgba(34, 211, 197, 0.2);
}

/* ---------- Documento (markdown) ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 7px; color: var(--muted-2); }

.doc {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px 44px; box-shadow: var(--shadow); max-width: 880px;
}
.doc > h1:first-child, .doc h1 { margin-top: 0; font-size: 1.9rem; }
.doc .lead { font-size: 1.08rem; color: var(--muted); margin: 6px 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }

.doc-body { font-size: 0.99rem; }
.doc-body p { line-height: 1.75; margin: 14px 0; }
.doc-body h2 { font-size: 1.4rem; margin: 34px 0 12px; }
.doc-body h2::before { content: ""; display: block; width: 42px; height: 3px; border-radius: 3px; background: var(--grad-brand); margin-bottom: 12px; }
.doc-body h3 { font-size: 1.12rem; margin: 26px 0 10px; color: var(--text); }
.doc-body h4 { margin: 20px 0 8px; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.82rem; }
.doc-body ul, .doc-body ol { padding-left: 22px; margin: 12px 0; }
.doc-body li { margin: 7px 0; line-height: 1.65; }
.doc-body li::marker { color: var(--primary); }
.doc-body strong { color: #fff; font-weight: 700; }
.doc-body a { font-weight: 600; border-bottom: 1px solid rgba(34, 211, 197, 0.35); }
.doc-body hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.doc-body code {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 7px; font-size: 0.86em; color: var(--accent); font-family: "SFMono-Regular", Consolas, monospace;
}
.doc-body pre {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 16px 0;
}
.doc-body pre code { background: none; border: none; padding: 0; color: var(--text); }
.doc-body blockquote {
  margin: 18px 0; padding: 14px 20px;
  background: var(--grad-brand-soft); border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0; color: var(--text);
}
.doc-body blockquote p { margin: 6px 0; }
.doc-body table {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.doc-body th { background: var(--bg-soft); color: var(--primary); text-align: left; padding: 11px 14px; font-weight: 700; }
.doc-body td { padding: 11px 14px; border-top: 1px solid var(--line); }
.doc-body tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }

.doc-cta { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.back-link { font-size: 0.9rem; color: var(--muted); }
.back-link:hover { color: var(--primary); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.panel { background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; font-size: 1.12rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { text-align: left; padding: 11px 9px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.reset-form { display: flex; gap: 4px; }
.reset-form input { width: 116px; padding: 6px 9px; font-size: 0.78rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.tag-admin { background: rgba(54, 198, 240, 0.16); color: #a9e3f7; }
.tag-vendedor { background: rgba(56, 224, 163, 0.16); color: #a9f3d6; }
.tag-on { background: rgba(56, 224, 163, 0.16); color: #a9f3d6; }
.tag-off { background: rgba(248, 113, 113, 0.16); color: #ffc9c9; }

/* ---------- Error ---------- */
.error-wrap { text-align: center; padding: 80px 20px; }
.error-wrap h1 { font-size: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center; padding: 26px 20px; color: var(--muted-2); font-size: 0.82rem;
  border-top: 1px solid var(--line-soft);
}
.site-footer b { color: var(--muted); }

/* ---------- Animaciones ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cat-block, .hero, .quicklinks, .doc { animation: rise .4s ease both; }
.cat-block:nth-child(2) { animation-delay: .04s; }
.cat-block:nth-child(3) { animation-delay: .08s; }
.cat-block:nth-child(4) { animation-delay: .12s; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
  .hero { padding: 26px 22px; }
  .hero h1 { font-size: 1.6rem; }
  .doc { padding: 28px 22px; }
}
@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
  .brand-name { display: none; }
  .topnav { gap: 12px; }
  .container { padding: 26px 16px 44px; }
}
