/* Antenna design system
 * Theme tokens are defined via tailwind.config in base.html (brand + ink palette).
 * This file adds reusable component classes layered on top of the CDN Tailwind build,
 * plus base typography, focus, and accessibility helpers.
 */

:root {
  --brand-50: #eef6ff;
  --brand-100: #d9eaff;
  --brand-200: #b6d4ff;
  --brand-500: #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1e40af;
  --accent-500: #0d9488;
  --ink-500: #475569;
  --ink-700: #334155;
  --ink-900: #0f172a;
}

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

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--ink-900);
}

/* Prevent horizontal overflow on small screens */
img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Visible, consistent focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link revealed on focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brand-600);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--brand-600);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-700);
}
.btn-secondary {
  background: #fff;
  color: var(--ink-900);
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.btn-ghost {
  background: transparent;
  color: var(--brand-700);
  min-height: 0;
  padding: 0.25rem 0.25rem;
  font-weight: 600;
}
.btn-ghost:hover {
  color: var(--brand-600);
  text-decoration: underline;
}

/* ---------- Cards ---------- */
.card {
  display: block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}
a.card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  border-color: var(--brand-200);
  transform: translateY(-2px);
}
.card-body {
  padding: 1rem 1.1rem;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}
.badge-brand {
  background: var(--brand-100);
  color: var(--brand-700);
}
.badge-accent {
  background: #ccfbf1;
  color: #0f766e;
}
/* WCAG AA contrast state colors */
.badge-success {
  background: #dcfce7;
  color: #166534;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ---------- Form fields ---------- */
.field {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  background: #fff;
  font-size: 0.95rem;
  color: var(--ink-900);
}
.field:focus {
  border-color: var(--brand-600);
}

/* Style Django {{ form.as_p }} output so auth forms match the system */
.auth-form p {
  margin-bottom: 1rem;
}
.auth-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--ink-700);
}
.auth-form input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  background: #fff;
  font-size: 0.95rem;
  color: var(--ink-900);
}
.auth-form input:focus {
  border-color: var(--brand-600);
}
.auth-form .helptext {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--ink-500);
}
.auth-form ul.errorlist {
  list-style: none;
  padding: 0;
  margin: 0 0 0.4rem;
  color: #991b1b;
  font-size: 0.85rem;
}

/* ---------- Nav links ---------- */
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.4rem;
  color: var(--ink-700);
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.4rem;
}
.nav-link:hover {
  color: var(--brand-700);
}

/* ---------- Prose readability ---------- */
.prose p {
  margin-bottom: 0.85rem;
}
