@import url('https://fonts.googleapis.com/css2?family=Zilla+Slab:wght@400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-card: #ffffff;
  --border: #e4e4e7;
  --border-subtle: #f4f4f5;
  --text-primary: #09090b;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  --accent: #15803d; /* Functional green accent */
  --accent-hover: #166534;
  --accent-subtle: #f0fdf4;
  --accent-foreground: #ffffff;
  --input-bg: #ffffff;
  --input-focus-ring: rgba(21, 128, 61, 0.2);
  --radius: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Zilla Slab", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-subtle: #121215;
    --bg-card: #18181b;
    --border: #27272a;
    --border-subtle: #1f1f23;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-subtle: #052e16;
    --accent-foreground: #09090b;
    --input-bg: #121215;
    --input-focus-ring: rgba(34, 197, 94, 0.25);
  }
}

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

html {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Strict 8pt Grid & Typography */
.container {
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 24px;
}

@media (min-width: 640px) {
  .container {
    padding: 64px 32px;
  }
}

.title-lg {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.title-md {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.text-sm {
  font-size: 13px;
  line-height: 1.4;
}

.text-xs {
  font-size: 12px;
  line-height: 1.4;
}

.text-muted {
  color: var(--text-secondary);
}

.text-faint {
  color: var(--text-muted);
}

/* Header & Navigation */
.site-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .header-inner {
    padding: 16px 32px;
  }
}

.brand {
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-inline {
  font-family: var(--font-brand);
  text-transform: lowercase;
  font-weight: 600;
}

.brand-green {
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Minimal Card / Box - strictly 1px flat border, no floating blur shadows */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Form System */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 14px;
  padding-right: 32px;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 540px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg);
  width: 100%;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  opacity: 0.8;
}

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

.btn-secondary:hover {
  background-color: var(--bg-subtle);
}

/* Status / Alert Banner */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
}

.alert-success {
  border-color: rgba(34, 197, 94, 0.3);
  background-color: var(--accent-subtle);
  color: var(--text-primary);
}

/* Definition / Key-Value Grid for Legal & Data */
.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0;
}

.kv-table tr {
  border-bottom: 1px solid var(--border-subtle);
}

.kv-table tr:last-child {
  border-bottom: none;
}

.kv-table th {
  text-align: left;
  padding: 10px 0;
  font-weight: 500;
  color: var(--text-secondary);
  width: 38%;
  vertical-align: top;
}

.kv-table td {
  padding: 10px 0;
  color: var(--text-primary);
  vertical-align: top;
}

/* Legal text formatting */
.legal-section {
  margin-bottom: 32px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.legal-section p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.legal-section li {
  margin-bottom: 4px;
}

/* Links */
a.link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

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

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Home minimal layout */
.home-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.home-brand {
  font-family: var(--font-brand);
  font-size: 36px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  user-select: none;
}
