/* ===========================================================
   BLACKSTOCK · CENTRO CLIENTES · DESIGN SYSTEM
   v3 · 2026-05 · editorial / premium / calm
   =========================================================== */

:root {
  color-scheme: dark;

  /* ── Surfaces ─────────────────────────────────────────────── */
  --bg:          #060607;
  --bg-elev:     #0a0a0c;
  --surface:     #0d0e10;
  --surface-2:   #131316;
  --surface-3:   #181a1d;

  /* ── Lines ────────────────────────────────────────────────── */
  --line-hair:   rgba(255, 255, 255, 0.04);
  --line:        rgba(255, 255, 255, 0.07);
  --line-2:      rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* ── Text ─────────────────────────────────────────────────── */
  --text:        #fafafa;
  --text-2:      rgba(250, 250, 250, 0.66);
  --text-3:      rgba(250, 250, 250, 0.42);
  --text-4:      rgba(250, 250, 250, 0.24);
  --text-5:      rgba(250, 250, 250, 0.14);

  /* ── Accent (acid · use sparingly) ────────────────────────── */
  --acid:        #d6ff4d;
  --acid-2:      #c1ec33;
  --acid-soft:   rgba(214, 255, 77, 0.08);
  --acid-line:   rgba(214, 255, 77, 0.18);

  /* ── Status ───────────────────────────────────────────────── */
  --ok:      #6ee7a8;
  --warn:    #fbbf24;
  --danger:  #f87171;
  --info:    #93c5fd;

  /* ── Type ─────────────────────────────────────────────────── */
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ── Radius ───────────────────────────────────────────────── */
  --r-1:  6px;
  --r-2:  10px;
  --r-3:  14px;
  --r-4:  18px;
  --r-5:  22px;
  --r-pill: 999px;

  /* ── Spacing scale ────────────────────────────────────────── */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 80px;

  /* ── Motion ───────────────────────────────────────────────── */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-base: 220ms;
  --t-slow: 360ms;

  /* ── Shadows (very subtle) ────────────────────────────────── */
  --shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.02) inset,
    0 24px 48px -28px rgba(0, 0, 0, 0.55);
  --shadow-pop:
    0 30px 80px -30px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --shadow-glow: 0 0 0 4px rgba(214, 255, 77, 0.12);
}

/* ──────────────────────────────────────────────────────────── */
/* RESET                                                        */
/* ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11", "tnum";
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

/* Subtle vignette + grain — never aggressive */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(214, 255, 77, 0.022), transparent 60%),
    radial-gradient(ellipse 80% 60% at 110% 110%, rgba(255, 255, 255, 0.012), transparent 55%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.022 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: overlay;
}

h1, h2, h3, h4, p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  letter-spacing: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button:focus { outline: none; }
button:focus-visible {
  outline: 1px solid var(--acid-line);
  outline-offset: 2px;
}

img, svg { display: block; max-width: 100%; }

::selection {
  background: rgba(214, 255, 77, 0.22);
  color: #0a0a0a;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.10); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ──────────────────────────────────────────────────────────── */
/* TYPOGRAPHY                                                   */
/* ──────────────────────────────────────────────────────────── */

.bs-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.bs-eyebrow.is-acid { color: var(--acid); }

.bs-num,
.bs-mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

/* .bs-italic intentionally removed — design system uses sans only for titles */

/* Display heading — editorial, calm */
.bs-display {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.96;
  color: var(--text);
  text-wrap: balance;
}
.bs-display em {
  font-style: normal;
  font-family: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
}

.bs-h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.0; }
.bs-h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.06; }
.bs-h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.bs-h4 { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }

.bs-lead {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 56ch;
}

.bs-muted   { color: var(--text-3); }
.bs-text-2  { color: var(--text-2); }
.bs-acid-fg { color: var(--acid); }

/* ──────────────────────────────────────────────────────────── */
/* BUTTONS                                                      */
/* ──────────────────────────────────────────────────────────── */

.btn,
.bs-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease),
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.btn:active:not(:disabled),
.bs-btn:active:not(:disabled) {
  transform: scale(0.985);
  transition-duration: 80ms;
}

.btn:disabled,
.bs-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-acid,
.bs-btn-acid {
  background: var(--acid);
  color: #0a0b07;
  border-color: var(--acid);
  font-weight: 600;
}
.btn-acid:hover:not(:disabled),
.bs-btn-acid:hover:not(:disabled) {
  background: #e2ff6c;
  border-color: #e2ff6c;
  filter: brightness(1.02);
}

.btn-outline,
.bs-btn-outline,
.bs-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}
.btn-outline:hover:not(:disabled),
.bs-btn-outline:hover:not(:disabled),
.bs-btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: rgba(248, 113, 113, 0.85);
  border-color: rgba(248, 113, 113, 0.22);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fca5a5;
}

.btn-compact { height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--r-2); }
.btn-block { width: 100%; }

.btn svg, .bs-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 1.6;
}

/* Subtle text link button */
.link-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
  transition: color var(--t-base) var(--ease), text-decoration-color var(--t-base) var(--ease);
}
.link-btn:hover {
  color: var(--text);
  text-decoration-color: var(--acid);
}

/* ──────────────────────────────────────────────────────────── */
/* PILLS / BADGES / DOTS                                        */
/* ──────────────────────────────────────────────────────────── */

.bs-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bs-pill.is-acid {
  background: var(--acid-soft);
  border-color: var(--acid-line);
  color: var(--acid);
}

.bs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.bs-dot.is-live {
  background: var(--acid);
  box-shadow: 0 0 0 0 rgba(214, 255, 77, 0.45);
  animation: bsLivePulse 2.4s ease-in-out infinite;
}
.bs-dot.is-warn { background: var(--warn); }
.bs-dot.is-danger { background: var(--danger); }
.bs-dot.is-ok { background: var(--ok); }

@keyframes bsLivePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 255, 77, 0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(214, 255, 77, 0); }
}

/* Status badge — thin outlined, mono small */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge.active   { color: var(--acid);   border-color: var(--acid-line);                background: var(--acid-soft); }
.badge.expired  { color: var(--warn);   border-color: rgba(251, 191, 36, 0.2);          background: rgba(251, 191, 36, 0.06); }
.badge.banned,
.badge.revoked  { color: #fca5a5;       border-color: rgba(248, 113, 113, 0.2);         background: rgba(248, 113, 113, 0.05); }
.badge.default  { color: var(--text-2); }

/* ──────────────────────────────────────────────────────────── */
/* INPUTS                                                       */
/* ──────────────────────────────────────────────────────────── */

input,
textarea,
select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  padding: 0 14px;
  height: 44px;
  outline: none;
  transition:
    border-color var(--t-base) var(--ease),
    background var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}
textarea {
  height: auto;
  min-height: 132px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.55;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-4);
}
input:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--line-strong);
}
input:focus,
textarea:focus {
  border-color: var(--acid-line);
  background: var(--surface-2);
  box-shadow: var(--shadow-glow);
}
input:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
input[readonly] {
  color: var(--text-2);
  background: var(--surface-2);
}

/* Field wrapper */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span,
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.field-textarea { gap: 6px; }

/* Hidden visually but accessible */
.field-label-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* ──────────────────────────────────────────────────────────── */
/* CARDS / PANELS / SURFACES                                    */
/* ──────────────────────────────────────────────────────────── */

.bs-card,
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  padding: var(--s-7);
  transition: border-color var(--t-base) var(--ease);
}

.bs-card.is-quiet {
  background: transparent;
  border-color: var(--line-hair);
}

.bs-divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* Section header */
.bs-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-6);
  padding-bottom: var(--s-5);
  margin-bottom: var(--s-6);
  border-bottom: 1px solid var(--line-hair);
}
.bs-section-head__main {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}
.bs-section-head__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-4);
  text-align: right;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────── */
/* MESSAGES                                                     */
/* ──────────────────────────────────────────────────────────── */

.msg,
.global-msg {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  min-height: 1px;
}
.msg:empty,
.global-msg:empty { display: none; }
.msg.is-ok,
.global-msg.is-ok { color: var(--ok); }
.msg.is-error,
.global-msg.is-error { color: var(--danger); }

/* ──────────────────────────────────────────────────────────── */
/* PUBLIC SHELL (login / register at /index.html)               */
/* ──────────────────────────────────────────────────────────── */

.public-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-6) var(--s-7);
  border-bottom: 1px solid var(--line-hair);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.public-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  flex-shrink: 0;
}
.public-brand-mark img,
.public-brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.public-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.public-brand-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.public-brand-subtitle {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}
.public-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.auth-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--s-9) var(--s-5) var(--s-10);
}

.auth-shell {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  padding: var(--s-8) var(--s-7) var(--s-7);
  box-shadow: var(--shadow-pop);
}
.auth-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--s-7);
}
.auth-head h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.auth-head p,
.auth-subtitle {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 4px;
  margin-bottom: var(--s-6);
}
.tab {
  height: 36px;
  border-radius: var(--r-2);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-3);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.auth-form .field-label { display: none; } /* placeholders are enough */
.auth-form .field span:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.auth-inline-help {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}
.auth-inline-help .link-btn {
  font-size: 13px;
  color: var(--text-3);
}
.auth-inline-help .link-btn:hover { color: var(--text); }

.verify-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

#auth-submit {
  margin-top: var(--s-2);
  height: 46px;
}

/* ──────────────────────────────────────────────────────────── */
/* MODAL                                                         */
/* ──────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--s-5);
}
.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: bsFadeIn 220ms var(--ease);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  padding: var(--s-7);
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elev) 100%);
  box-shadow: var(--shadow-pop);
  animation: bsModalIn 280ms var(--ease);
}
.modal-card-narrow { width: min(480px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.modal-head h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-top: 6px;
}

@keyframes bsFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bsModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ──────────────────────────────────────────────────────────── */
/* REVEAL ON SCROLL                                              */
/* ──────────────────────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ──────────────────────────────────────────────────────────── */
/* RESPONSIVE                                                    */
/* ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .public-topbar {
    padding: var(--s-4) var(--s-5);
  }
  .public-brand-subtitle { display: none; }

  .auth-stage {
    padding: var(--s-7) var(--s-4) var(--s-9);
  }
  .auth-shell {
    padding: var(--s-7) var(--s-5) var(--s-6);
    border-radius: var(--r-4);
  }
}

@media (max-width: 420px) {
  .public-topbar-actions .btn-outline { display: none; }
}
