:root {
  color-scheme: light;
  --color-bg: #fdf6f0;
  --color-surface: #ffffff;
  --color-primary: #c2703d;
  --color-text: #2c2622;
  --color-muted: #8a7d73;
  --color-error: #b3261e;
  --color-border: #e6dcd2;
  --breakpoint-desktop: 60rem;
  --tap-target-min: 44px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: #fff;
}

.app-header h1 {
  font-size: 1.1rem;
  margin: 0;
  flex: 1;
}

.icon-button {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  min-width: var(--tap-target-min);
  min-height: var(--tap-target-min);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.app-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 5rem;
}

.recipe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipe-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.recipe-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.recipe-card .category {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-muted);
}

.fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.button {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.button.secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.button.danger {
  background: var(--color-error);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
}

.field textarea {
  min-height: 6rem;
  resize: vertical;
}

.field .hint {
  color: var(--color-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.field-error {
  color: var(--color-error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--color-error);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h2 {
  font-size: 1rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-section ol,
.detail-section ul {
  padding-left: 1.25rem;
  margin: 0;
}

.detail-section li {
  margin-bottom: 0.4rem;
}

.detail-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.banner-error {
  background: #fbe9e7;
  color: var(--color-error);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

/*
 * Surcharges desktop (mobile-first : base ci-dessus pour petit écran,
 * enrichie ici pour les grands écrans — jamais l'inverse).
 */
@media (min-width: 60rem) {
  body {
    background: var(--color-border);
  }

  .app-header {
    padding: 1rem 2rem;
  }

  .app-header h1 {
    font-size: 1.3rem;
  }

  .app-main {
    max-width: 1100px;
    padding: 2rem;
    padding-bottom: 3rem;
  }

  .recipe-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
  }

  .recipe-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
  }

  .recipe-card:hover,
  .recipe-card:focus-visible {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
  }

  .fab {
    right: 2rem;
    bottom: 2rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
  }

  .fab:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
  }

  .button:hover:not(:disabled) {
    filter: brightness(1.08);
  }

  .button.secondary:hover:not(:disabled) {
    background: rgba(194, 112, 61, 0.08);
  }

  form {
    max-width: 640px;
  }
}
