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

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

.app {
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(40px, 9vw, 56px); line-height: 1.05; }
h2 { font-size: 28px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }

p { margin: 0; }

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

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

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

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.btn--block { width: 100%; }

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 17px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus { border-color: var(--color-text); }

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

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"],
.chip.is-selected {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

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

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-5); }
.stack-sm > * + * { margin-top: var(--space-2); }

.row { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.footer {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
}

.sticky-cta {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--color-bg) 70%, rgba(255,255,255,0));
  padding: var(--space-4) 0 var(--space-5);
  margin-top: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}
.toast.is-visible { opacity: 1; }
