/*
 * Motiva Platform — self-hosted stylesheet (T-PLAT-01-FIX-06).
 *
 * Replaces the runtime `https://cdn.tailwindcss.com` script (executable JS from
 * a third party — a supply-chain risk) with a static, locally-served CSS file.
 * It is a curated subset of Tailwind utilities covering exactly the classes used
 * by the templates under `templates/`, plus a small preflight reset and the
 * font-family custom properties that previously lived in an inline `<style>`
 * block (which a strict `style-src 'self'` CSP forbids).
 *
 * To regenerate after adding new utility classes, see `static/src/input.css`
 * and `tools/fetch_vendor.py` (or rebuild with the Tailwind standalone CLI).
 */

/* --- Custom properties (moved out of base.html inline <style>) ------------- */
:root {
  --font-ui: "Geist", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: "Satoshi", "Geist", system-ui, sans-serif;
  --tw-ring-color: rgb(59 130 246 / 0.5);
}

/* --- Preflight (minimal Tailwind-style reset) ------------------------------ */
*,
::before,
::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e4e4e7;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-ui);
}

body {
  margin: 0;
  line-height: inherit;
  font-family: var(--font-ui);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button {
  background-color: transparent;
  background-image: none;
  cursor: pointer;
}

[hidden] {
  display: none;
}

/* --- Fonts ----------------------------------------------------------------- */
.font-display {
  font-family: var(--font-display);
}
.font-mono {
  font-family: var(--font-mono);
}

/* --- Display / layout ------------------------------------------------------ */
.block {
  display: block;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}
.relative {
  position: relative;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-x-auto {
  overflow-x: auto;
}

.flex-1 {
  flex: 1 1 0%;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.shrink-0 {
  flex-shrink: 0;
}
.min-w-0 {
  min-width: 0;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.items-baseline {
  align-items: baseline;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.25rem;
}
.gap-1\.5 {
  gap: 0.375rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}

/* --- Sizing ---------------------------------------------------------------- */
.h-full {
  height: 100%;
}
.h-1\.5 {
  height: 0.375rem;
}
.w-full {
  width: 100%;
}
.w-72 {
  width: 18rem;
}
.w-1\.5 {
  width: 0.375rem;
}
.max-w-3xl {
  max-width: 48rem;
}

/* --- Spacing: margin ------------------------------------------------------- */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.ml-3 {
  margin-left: 0.75rem;
}
.mr-1 {
  margin-right: 0.25rem;
}
.mt-0\.5 {
  margin-top: 0.125rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-1\.5 {
  margin-top: 0.375rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-6 {
  margin-top: 1.5rem;
}

/* --- Spacing: padding ------------------------------------------------------ */
.p-2 {
  padding: 0.5rem;
}
.p-2\.5 {
  padding: 0.625rem;
}
.p-3 {
  padding: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.pb-2 {
  padding-bottom: 0.5rem;
}
.px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.px-1\.5 {
  padding-left: 0.375rem;
  padding-right: 0.375rem;
}
.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.px-2\.5 {
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.px-3\.5 {
  padding-left: 0.875rem;
  padding-right: 0.875rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}
.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}
.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-2\.5 {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}
.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* --- Spacing between children (space-y / divide-y) ------------------------- */
.space-y-0\.5 > * + * {
  margin-top: 0.125rem;
}
.space-y-2 > * + * {
  margin-top: 0.5rem;
}
.space-y-6 > * + * {
  margin-top: 1.5rem;
}
.divide-y > * + * {
  border-top-width: 1px;
}
.divide-zinc-100 > * + * {
  border-color: #f4f4f5;
}

/* --- Borders / radius / shadow --------------------------------------------- */
.border {
  border-width: 1px;
}
.border-b {
  border-bottom-width: 1px;
}
.border-dashed {
  border-style: dashed;
}
.border-zinc-200 {
  border-color: #e4e4e7;
}
.border-zinc-300 {
  border-color: #d4d4d8;
}
.border-rose-200 {
  border-color: #fecdd3;
}
.rounded {
  border-radius: 0.25rem;
}
.rounded-md {
  border-radius: 0.375rem;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-full {
  border-radius: 9999px;
}
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* --- Backgrounds ----------------------------------------------------------- */
.bg-white {
  background-color: #ffffff;
}
.bg-zinc-50 {
  background-color: #fafafa;
}
.bg-zinc-100 {
  background-color: #f4f4f5;
}
.bg-zinc-200 {
  background-color: #e4e4e7;
}
.bg-zinc-800 {
  background-color: #27272a;
}
.bg-emerald-50 {
  background-color: #ecfdf5;
}
.bg-emerald-600 {
  background-color: #059669;
}
.bg-amber-50 {
  background-color: #fffbeb;
}
.bg-amber-100 {
  background-color: #fef3c7;
}
.bg-rose-50 {
  background-color: #fff1f2;
}
.bg-rose-100 {
  background-color: #ffe4e6;
}
.bg-rose-500 {
  background-color: #f43f5e;
}
.bg-sky-50 {
  background-color: #f0f9ff;
}
.bg-violet-50 {
  background-color: #f5f3ff;
}

/* --- Text colour ----------------------------------------------------------- */
.text-white {
  color: #ffffff;
}
.text-zinc-300 {
  color: #d4d4d8;
}
.text-zinc-400 {
  color: #a1a1aa;
}
.text-zinc-500 {
  color: #71717a;
}
.text-zinc-600 {
  color: #52525b;
}
.text-zinc-700 {
  color: #3f3f46;
}
.text-zinc-800 {
  color: #27272a;
}
.text-zinc-900 {
  color: #18181b;
}
.text-emerald-600 {
  color: #059669;
}
.text-emerald-700 {
  color: #047857;
}
.text-amber-700 {
  color: #b45309;
}
.text-rose-600 {
  color: #e11d48;
}
.text-rose-700 {
  color: #be123c;
}
.text-sky-700 {
  color: #0369a1;
}
.text-violet-700 {
  color: #6d28d9;
}

/* --- Font size ------------------------------------------------------------- */
.text-\[10px\] {
  font-size: 10px;
  line-height: 1.4;
}
.text-\[11px\] {
  font-size: 11px;
  line-height: 1.4;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

/* --- Font weight ----------------------------------------------------------- */
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

/* --- Typography helpers ---------------------------------------------------- */
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.uppercase {
  text-transform: uppercase;
}
.tracking-tight {
  letter-spacing: -0.025em;
}
.tracking-wide {
  letter-spacing: 0.025em;
}
.leading-none {
  line-height: 1;
}
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-none {
  list-style: none;
}
.cursor-pointer {
  cursor: pointer;
}

/* --- State variants -------------------------------------------------------- */
.empty\:hidden:empty {
  display: none;
}
.placeholder\:text-zinc-400::placeholder {
  color: #a1a1aa;
}

.hover\:bg-emerald-100:hover {
  background-color: #d1fae5;
}
.hover\:bg-emerald-700:hover {
  background-color: #047857;
}
.hover\:bg-rose-50:hover {
  background-color: #fff1f2;
}
.hover\:bg-zinc-50:hover {
  background-color: #fafafa;
}
.hover\:bg-zinc-200:hover {
  background-color: #e4e4e7;
}
.hover\:bg-zinc-700:hover {
  background-color: #3f3f46;
}
.hover\:text-zinc-600:hover {
  color: #52525b;
}
.hover\:text-zinc-800:hover {
  color: #27272a;
}
.hover\:underline:hover {
  text-decoration-line: underline;
}

.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.focus\:ring-2:focus {
  box-shadow: 0 0 0 2px var(--tw-ring-color);
}
.focus\:ring-emerald-500:focus {
  --tw-ring-color: #10b981;
}

/* --- Responsive (sm: ≥ 640px) ---------------------------------------------- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sm\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}
