/* ══ Corpus.ad — Shared Design Tokens & Base Components ══ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ── Tokens ── */
:root {
  --white: #FFFFFF;
  --ivory: #F7F7F5;
  --gray: #E8E8E6;
  --mid: #A1A1A1;
  --dark-text: #71717A;
  --black: #09090B;
  --accent: #1a1a4a;
  --accent-hover: #2c2c5e;
  --accent-visible: #3d3d7a;
  --focus-ring: rgba(26,26,74,0.18);
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Base body ── */
body {
  font-family: var(--sans);
  color: var(--black);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Link reset ── */
a { color: inherit; text-decoration: none; }

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible {
  outline: none;
}

/* ── Grain overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 3rem;
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid var(--gray);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  font-style: italic;
  text-transform: uppercase;
  color: var(--black);
}

/* ── Button ── */
.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.85rem 2.4rem;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  box-shadow: none;
  text-decoration: none;
  text-align: center;
}
.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(26,26,74,0.14);
}
.btn:disabled {
  cursor: wait;
  opacity: 0.72;
}
.btn-full { width: 100%; }

/* ── Badge ── */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  flex-shrink: 0;
}
.badge-active { background: rgba(31,139,85,0.1); color: #175a3c; }
.badge-trial { background: rgba(26,26,74,0.08); color: var(--accent); }
.badge-inactive,
.badge-expired { background: rgba(176,61,61,0.08); color: #842f2f; }

/* ── Hint ── */
.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--dark-text);
  line-height: 1.55;
  text-align: center;
}
.hint a { color: var(--black); text-decoration: underline; text-underline-offset: 2px; }

/* ── Loading ── */
.loading {
  text-align: center;
  color: var(--mid);
  font-size: 0.92rem;
}

/* ── Dialog ── */
.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(9,9,11,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  place-items: center;
}
.dialog-overlay.open { display: grid; }
.dialog-box {
  width: calc(100% - 2rem);
  max-width: 420px;
  background: var(--white);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 50px rgba(9,9,11,0.12);
  position: relative;
}
.dialog-close {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none; border: none;
  font-size: 1.3rem;
  color: var(--mid);
  cursor: pointer;
  line-height: 1;
  border-radius: 8px;
}
.dialog-close:hover { color: var(--black); background: rgba(0,0,0,0.04); }
.dialog-box h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

/* ── Responsive: Nav ── */
@media (max-width: 520px) {
  nav { padding: 0.9rem 1.5rem; }
  .nav-brand { font-size: 1.15rem; }
}
