/* KursorLink · mismo lenguaje visual que la app de escritorio (Fluent + degradado de marca). */
:root {
  color-scheme: light dark;
  --brand-1: #7C5CFF;
  --brand-2: #22D3EE;
  --brand: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --night: #0F0C29;
  --danger: #FF4D4F;
  --warning: #F59E0B;
  --success: #22C55E;

  --bg: #f3f3f6;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --stroke: rgba(0, 0, 0, .08);
  --text: #1c1b22;
  --text-2: #5c5b6b;
  --accent-text: #5b3ff2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(20, 16, 60, .06);
  --radius: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b22;
    --surface: #26252e;
    --surface-2: #2e2d37;
    --stroke: rgba(255, 255, 255, .08);
    --text: #f2f2f7;
    --text-2: #b4b3c4;
    --accent-text: #b3a3ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 1.55rem; font-weight: 650; margin-top: 1.6em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1100px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Barra superior --- */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(160%) blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--stroke); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.05rem; }
.nav-desktop { margin-left: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent-text); font-weight: 600; }
.nav a.btn-primary { background: var(--brand-1); color: #fff; padding: 8px 16px; margin-left: 6px; }
.nav a.btn-primary:hover { background: var(--brand-1); filter: brightness(1.08); }
.nav form { margin: 0; }
.menu { margin-left: auto; display: none; }
.menu summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--stroke); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .nav { position: absolute; right: 24px; top: 58px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; min-width: 220px; }
@media (max-width: 860px) {
  .topbar .nav-desktop { display: none; }
  .menu { display: block; }
}

/* --- Banners a sangre (mismas ilustraciones que la app) --- */
.banner { position: relative; isolation: isolate; color: #fff; background: var(--night) var(--banner-img, none) right center / cover no-repeat; min-height: 280px; display: flex; align-items: center; }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(15, 12, 41, .96) 0%, rgba(15, 12, 41, .72) 42%, rgba(15, 12, 41, 0) 75%); }
.banner .wrap { padding: 56px 0; }
.banner h1 { color: #fff; max-width: 640px; }
.banner p { color: rgba(255, 255, 255, .88); max-width: 600px; font-size: 1.1rem; }
.banner.hero { min-height: 460px; }
.banner .pill { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .28); margin-bottom: 14px; }
.banner.compact { min-height: 220px; }
.banner-home { --banner-img: url(/brand/banners/home.jpg); }
.banner-connect { --banner-img: url(/brand/banners/connect.jpg); }
.banner-trusted { --banner-img: url(/brand/banners/trusted.jpg); }
.banner-activity { --banner-img: url(/brand/banners/activity.jpg); }
.banner-settings { --banner-img: url(/brand/banners/settings.jpg); }
@media (max-width: 720px) { .banner::before { background: rgba(15, 12, 41, .82); } }

/* --- Botones --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 9px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--stroke); background: var(--surface); color: var(--text); transition: transform .08s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-1); border-color: transparent; color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* --- Secciones y tarjetas --- */
.section { padding: 56px 0; }
.section-tight { padding: 32px 0 56px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-top: 12px; }
.card p:last-child { margin-bottom: 0; }
.spaced { margin-top: 18px; }
.prose.card { max-width: none; }
.feature img { width: 56px; height: 56px; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 760px; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: color-mix(in srgb, var(--brand-1) 16%, transparent); color: var(--accent-text); }
.notice { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius); padding: 16px 18px; border: 1px solid; margin: 0 0 20px; }
.notice img { width: 32px; height: 32px; flex: none; }
.notice p { margin: 0; }
.notice-warning { background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.notice-info { background: color-mix(in srgb, var(--brand-1) 10%, transparent); border-color: color-mix(in srgb, var(--brand-1) 35%, transparent); }
.notice-danger { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.notice-success { background: color-mix(in srgb, var(--success) 10%, transparent); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.license-strip { background: var(--surface); border-block: 1px solid var(--stroke); }
.license-strip .wrap { display: flex; gap: 20px; align-items: center; padding: 22px 0; flex-wrap: wrap; }
.license-strip p { margin: 0; flex: 1 1 420px; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: flex; gap: 16px; align-items: flex-start; }
.steps li::before { content: counter(step); flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--brand); }

/* --- Texto largo (legal) --- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.3rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.prose th { color: var(--text-2); font-weight: 600; }

/* --- Formularios --- */
.auth { display: grid; place-items: start center; padding: 48px 0 72px; }
.auth .card { width: min(460px, 100%); padding: 32px; }
.auth h1 { font-size: 1.7rem; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input[type=email], .field input[type=password], .field input[type=text] { width: 100%; font: inherit; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--stroke); background: var(--surface-2); color: var(--text); }
.field input:focus { outline: 2px solid var(--brand-1); outline-offset: 0; border-color: transparent; }
.field .hint { font-size: .85rem; color: var(--text-2); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: .95rem; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--brand-1); flex: none; }
.field-error, .validation-summary-errors { color: var(--danger); font-size: .9rem; }
.validation-summary-errors ul { margin: 0 0 12px; padding-left: 1.1em; }
.input-validation-error { border-color: var(--danger) !important; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 14px; margin: 8px auto 16px; width: fit-content; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.secret { font-family: var(--mono); font-size: 1rem; letter-spacing: .06em; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; word-break: break-all; text-align: center; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--mono); font-size: 1.05rem; padding: 0; list-style: none; }
.codes li { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; text-align: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 8px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }
details.panel { border-top: 1px solid var(--stroke); padding: 14px 0; }
details.panel summary { cursor: pointer; font-weight: 600; }
details.panel[open] summary { margin-bottom: 12px; }

/* --- Pie --- */
.footer { border-top: 1px solid var(--stroke); background: var(--surface); padding: 40px 0 28px; margin-top: 24px; font-size: .92rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 2fr repeat(3, 1fr); }
.footer h4 { margin: 0 0 10px; font-size: .95rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer .legal-line { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--stroke); color: var(--text-2); display: flex; flex-wrap: wrap; gap: 8px 22px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
