/*
  Shared reset + component primitives used by public.css, auth.css and dashboard.css.
  Depends on tokens.css being loaded first.
*/

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

html {
  -webkit-text-size-adjust: 100%;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  color: var(--text-heading);
  font-weight: 500;
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.22;
}

h2 {
  font-size: 22px;
  line-height: 1.3;
}

p {
  margin: 0;
}

.text-secondary {
  color: var(--text-secondary);
  font-size: 13px;
}

.text-muted {
  color: var(--text-muted);
  font-size: 12px;
}

.text-accent {
  color: var(--accent-light);
}

/* Focus states — always visible for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--section-padding-y) 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 4px;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
}

.card-inset {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* Badges / status pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: transparent;
}

.badge-success,
.badge-linked,
.badge-paid {
  color: var(--success);
  border-color: var(--success);
  background: rgba(76, 175, 125, 0.1);
}

.badge-accent,
.badge-recommended,
.badge-approved,
.badge-waiting_user {
  color: var(--accent-light);
  border-color: var(--accent);
  background: var(--accent-tint);
}

.badge-warning,
.badge-pending,
.badge-requested,
.badge-open,
.badge-waiting_admin {
  color: var(--warning);
  border-color: var(--warning);
  background: rgba(201, 162, 39, 0.1);
}

.badge-danger,
.badge-rejected {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(201, 86, 76, 0.1);
}

.badge-paused,
.badge-void,
.badge-closed {
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input,
select.input,
textarea.input {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
}

.input:focus {
  border-color: var(--accent);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
}

.field-checkbox {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.field-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.field-checkbox input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.field-checkbox a {
  color: var(--accent-light);
}

/* Honeypot anti-bot field — off-screen, not display:none/visibility:hidden, since some
   bots specifically skip filling fields hidden that way. Real users never see or tab
   into it (tabindex="-1" on the input itself, see templates/auth/register.html). */
.field-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Buttons styled as inline text links (e.g. logout, resend actions inside a form) */
.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.link-button:hover {
  color: var(--text-primary);
}

/* Flash messages */
.messages {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.message-success {
  color: var(--success);
  border-color: var(--success);
  background: rgba(76, 175, 125, 0.1);
}

.message-error {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(201, 86, 76, 0.1);
}

/* Icon tile */
.icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(47, 191, 168, 0.18), rgba(47, 191, 168, 0.04));
  border: 0.5px solid rgba(93, 217, 196, 0.25);
}

.icon-tile svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-light);
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-mark svg {
  width: 16px;
  height: 16px;
  stroke: var(--on-accent);
}

.logo-mark img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.logo-wordmark {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.25;
}

.logo-wordmark small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Footer disclaimer */
.disclaimer {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
