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

:root {
  --color-bg: #f0f4f1;
  --color-surface: #ffffff;
  --color-primary: #2d6a4f;
  --color-primary-light: #52b788;
  --color-primary-muted: #e8f5ee;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-border: #e2e8e4;
  --color-danger: #dc2626;
  --color-danger-muted: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 999px;
  --nav-height: 64px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --transition: 150ms ease;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg);
}

.page {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  padding-bottom: calc(var(--nav-height) + 20px);
}

.page-header {
  margin-bottom: 20px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 2px;
}

button {
  font-size: 1rem;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  min-height: 44px;
  padding: 0 16px;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
}

button:active { opacity: 0.75; }

/* bottone distruttivo in ghost style — meno aggressivo del solid rosso */
.btn-clear {
  width: 100%;
  background: transparent;
  color: var(--color-danger);
  border: 1.5px solid var(--color-danger);
  margin-top: 16px;
  font-weight: 600;
}

.btn-clear:active {
  background: var(--color-danger-muted);
  opacity: 1;
}

input[type="text"],
input[type="number"] {
  font-size: 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 48px;
  width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

input::placeholder {
  color: #b0bab4;
}
