:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --border: #333;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --accent: #fb923c;
  --success: #22c55e;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

/* Form */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

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

.field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field input[type="number"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s;
}

.field input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
}

.yeast-type {
  margin-bottom: 1.5rem;
}

.radio-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.radio {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.radio:has(input:checked) {
  background: rgba(234, 88, 12, 0.15);
  border-color: var(--primary);
  color: var(--accent);
}

.radio input {
  accent-color: var(--primary);
}

/* Button */
.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.95rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

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

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

.btn.primary:active {
  transform: scale(0.98);
}

/* Result */
.result .total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}

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

.total .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.ingredients {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ingredient {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.ingredient .icon {
  font-size: 1.4rem;
  width: 2.2rem;
  text-align: center;
}

.ingredient .info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ingredient .name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ingredient .name small {
  opacity: 0.7;
}

.ingredient .grams {
  font-size: 1.25rem;
  font-weight: 600;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.meta-item {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  text-align: center;
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.meta-value {
  font-weight: 600;
  font-size: 0.95rem;
}

.note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--success);
  padding: 0.7rem 0.9rem;
  border-radius: 0 8px 8px 0;
}

/* Info section */
.info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.info li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
}

.info li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
}

.info .small {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Mobile tweaks */
@media (max-width: 400px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .radio-group {
    flex-direction: column;
  }
}
