/* Adhook design tokens (docs/FRONTEND.md section 2). CSS variables only, no hardcoded colors. */

/* Self-hosted fonts (no third-party CDN). Sentient = display (variable 200-700 + italic),
   Inter = UI/body, JetBrains Mono = mono. Inter/JBM are split into latin + latin-ext subsets. */
@font-face {
  font-family: "Sentient";
  src: url("/static/fonts/sentient-variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sentient";
  src: url("/static/fonts/sentient-italic-variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jbm-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jbm-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Palette - warm charcoal base (visual refresh 2026-07-14). RGB triplets below let rgba()
     compose from the same source of truth. */
  --bg: #100e0b;
  --bg-2: #15120d;
  --surface: #1b1712;
  --surface-2: #231e17;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --tx: #f7f3ec;
  --tx-2: #b3aa99;
  --tx-3: #7c7365;
  --lime: #d4f84b;
  --lime-hover: #e1ff5c;
  --lime-dim: rgba(212, 248, 75, 0.3);
  --lime-tint: rgba(212, 248, 75, 0.07);
  --on-lime: #000000;
  --good: #9be37a;
  --good-dim: rgba(155, 227, 122, 0.3);
  --good-tint: rgba(155, 227, 122, 0.07);
  --warn: #e8c45a;
  --warn-dim: rgba(232, 196, 90, 0.3);
  --warn-tint: rgba(232, 196, 90, 0.07);
  --bad: #ff8080;
  --bad-dim: rgba(255, 128, 128, 0.3);
  --bad-tint: rgba(255, 128, 128, 0.07);

  /* Accents split out of lime's overloaded roles: focus + secondary/data-viz get their own. */
  --violet: #8b7dff;
  --focus: #a99bff;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-line: rgba(255, 255, 255, 0.13);
  --bg-rgb: 16, 14, 11;
  --lime-rgb: 212, 248, 75;
  --violet-rgb: 139, 125, 255;

  /* Self-hosted faces (see @font-face above). Sentient = display, Inter = UI, JetBrains = mono. */
  --font-display: "Sentient", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --r-control: 11px;
  --r-card: 16px;
  --h-control: 40px;

  /* Scales (intent, not one-off literals). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 20px 50px rgba(0, 0, 0, 0.5);
  --z-base: 1;
  --z-dropdown: 20;
  --z-sticky: 30;
  --z-scrim: 40;
  --z-modal: 50;
  --z-toast: 60;
  --dur-fast: 0.12s;
  --dur-base: 0.18s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(60% 60% at 50% 0%, var(--bg-2), var(--bg));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--lime);
  color: var(--on-lime);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--tx);
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 6px;
}

.auth-sub {
  color: var(--tx-2);
  font-size: 14px;
  margin: 0 0 24px;
}

.policy-list {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--tx);
  font-size: 14px;
  line-height: 1.6;
}
.policy-list li {
  margin-bottom: 6px;
}
.policy-note {
  color: var(--tx-2);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.policy-meta {
  color: var(--tx-3);
  font-size: 12.5px;
  margin: -2px 0 20px;
}
.policy-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
}
.policy-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.policy-card-h {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.policy-card .policy-dl {
  margin: 0;
}
.policy-card .policy-dl dt:first-child {
  margin-top: 6px;
}
.policy-dl {
  margin: 0 0 20px;
  font-size: 14px;
}
.policy-dl dt {
  color: var(--tx-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 14px;
}
.policy-dl dd {
  color: var(--tx);
  margin: 2px 0 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 13px;
  color: var(--tx-2);
}

/* Required-field marker next to the label (decorative; the input carries `required`). */
.field-label .req {
  color: var(--tx-2);
  margin-left: 3px;
}

.input {
  height: var(--h-control);
  padding: 0 13px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--tx);
  font-family: var(--font-ui);
  font-size: 14px;
}

.input:focus {
  outline: none;
  border-color: var(--lime);
}

.btn {
  height: var(--h-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--lime);
  color: var(--on-lime);
}
.btn-primary:hover {
  background: var(--lime-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--tx);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--tx-3);
}

/* Destructive actions (sign out everywhere, delete, etc.). Tinted-red so it reads as danger without
   shouting on the dark theme; fills in on hover. */
.btn-danger {
  background: var(--bad-tint);
  border-color: var(--bad);
  color: var(--bad);
}
.btn-danger:hover {
  background: var(--bad-dim);
  color: var(--tx);
}

/* Full-width variant for form submits and footer rows (fills its flex row or block parent). */
.btn-block {
  flex: 1;
  width: 100%;
}

/* A form submit that reads as a plain text link (no button chrome) - for low-emphasis actions like
   a routine single-device sign out. */
.btn-textlink {
  background: none;
  border: none;
  padding: 0;
  height: auto;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--tx-2);
  text-decoration: underline;
  cursor: pointer;
}
.btn-textlink:hover {
  color: var(--tx);
}

.auth-foot {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--tx-3);
  text-align: center;
}
.auth-foot a {
  color: var(--tx-2);
  text-decoration: none;
  font-weight: 500;
  transition: 0.12s;
}
.auth-foot a:hover {
  color: var(--lime);
}

.alert {
  border-radius: var(--r-control);
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--line-2);
}

.alert-bad {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-tint);
}

.alert-warn {
  color: var(--warn);
  border-color: var(--warn);
  background: rgba(232, 196, 90, 0.08);
}

.alert-good {
  color: var(--good);
  border-color: var(--good);
  background: var(--good-tint);
}

/* Neutral informational notice (not a success, not a problem) - lime-tinted like .scraped-note. */
.alert-info {
  color: var(--tx-2);
  border-color: rgba(var(--lime-rgb), 0.18);
  background: rgba(var(--lime-rgb), 0.06);
}

/* Transient confirmation toast: one fixed node per page (app_base/admin_base), shown by
   window.adhookToast for short confirmations ("Copied", "Saved"); errors stay inline alerts.
   Inverse colors so it reads above any surface. */
.toast {
  position: fixed;
  /* top-center, under the topbar: the bottom edge is owned by the fixed composer bar on the
     tool pages (and the popup foot on mobile), so a bottom toast would cover controls. */
  top: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--tx);
  color: var(--bg);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 11px;
  opacity: 0;
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

/* Skeleton shimmer, shown only while an htmx swap is in flight (first paint is server-rendered).
   htmx puts .htmx-request on the hx-indicator element itself; the sibling combinator hides the
   real content it stands in for. */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.skel:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: sweep 1.7s linear infinite;
}
.skel-card {
  /* story is the default format, so most real cards are 9:16 - match them */
  aspect-ratio: 9 / 16;
  /* mirrors .gcard's flow inside the .gal column layout */
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 14px;
}
/* Two classes so this beats `.gal { display: grid }` (equal 1-class specificity would let the later
   .gal rule win and un-hide the skeleton). Hidden until a search/filter swap is in flight. */
.gal.gal-skel {
  display: none;
}
/* .gal is a grid, so the active skeleton uses the same grid flow for its placeholder cards. */
.gal.gal-skel.htmx-request {
  display: grid;
}
.gal.gal-skel.htmx-request ~ .gal {
  display: none;
}
.skel-row {
  /* matches the real .drow height (13px padding x2 + text line + credit bar) */
  height: 54px;
  border-radius: 10px;
  margin: 6px 0;
}
.rows-skel {
  display: none;
}
.rows-skel.htmx-request {
  display: block;
}
.rows-skel.htmx-request ~ div {
  display: none;
}
/* Inside a .dtbl the table surface IS var(--surface), so the skeleton needs a step up or it
   reads as an empty table. */
.dtbl .skel-row {
  background: var(--surface-2);
  border-color: var(--line-2);
  margin: 6px 10px;
}

/* "or" divider + full-width Google button on the sign-in page. */
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--tx-3);
  font-size: 13px;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

[x-cloak] {
  display: none !important;
}

