/* ============================================
   Vouchr — Anthropic-inspired design system
   Warm cream, slate text, generous whitespace
   ============================================ */

:root {
  /* Surfaces */
  --canvas: #faf9f5;
  --surface: #faf9f5;
  --surface-secondary: #f0eee6;
  --surface-hover: #e8e6dc;
  --border: #e5e2d9;
  --border-strong: #d4d0c4;

  /* Text */
  --text: #141413;
  --text-secondary: #5e5d59;
  --text-muted: #8e8d88;

  /* Accents */
  --accent: #d97757;          /* clay */
  --accent-soft: #ebcece;
  --black: #141413;
  --white: #faf9f5;

  /* Status */
  --success: #788c5d;
  --success-bg: #e8efe0;
  --warning: #c6613f;
  --neutral: #6a6966;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Spacing & radius */
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-soft: 0 1px 2px rgba(20, 20, 19, 0.04);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-family: var(--font-serif);
  font-weight: 400;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
}

.lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

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

.small {
  font-size: 0.875rem;
}

.center-text {
  text-align: center;
}

.mt-lg {
  margin-top: 2.5rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container.narrow {
  max-width: 640px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.text-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn-primary:hover {
  background: #2a2a28;
  border-color: #2a2a28;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-secondary);
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.4rem 0.875rem;
}

.btn-full {
  width: 100%;
}

/* Hero */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.1875rem;
  max-width: 540px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--surface-secondary);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.section-alt .card {
  background: var(--canvas);
}

.step {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card p {
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner .logo {
  font-size: 1.125rem;
}

/* Auth */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.auth-card > .muted {
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 0.7rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--text);
  transition: border-color 0.15s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--text);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.demo-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.demo-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Dashboard */
.dashboard {
  padding: 2.5rem 0 4rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.875rem;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Voucher cards (recipient) */
.voucher-list {
  display: grid;
  gap: 1rem;
}

.voucher-card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.voucher-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.voucher-org {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.voucher-amount {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin: 0.25rem 0;
}

.voucher-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success);
}

.badge-redeemed {
  background: var(--surface-secondary);
  color: var(--text-secondary);
}

.badge-expired {
  background: #f5e8e4;
  color: var(--warning);
}

/* Table (employee) */
.table-section {
  margin-top: 0.5rem;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-header h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.filters {
  display: flex;
  gap: 0.35rem;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  background: var(--surface-secondary);
}

.filter-btn.active {
  background: var(--black);
  color: var(--white);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.875rem 1.25rem;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(240, 238, 230, 0.5);
}

.data-table code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--surface-secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero {
    padding: 4rem 0 3.5rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .page-header {
    flex-direction: column;
  }

  .voucher-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
}
