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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fffaf3;
  color: #333;
  padding: 1rem;
  padding-bottom: 6rem;
  min-height: 100vh;
}

.screen.hidden, .hidden { display: none !important; }

/* AUTH */
#auth-screen { max-width: 400px; margin: 4rem auto 0; }
#auth-screen h1 { text-align: center; margin-bottom: 2rem; font-size: 1.8rem; }

.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.tab {
  flex: 1; padding: 0.6rem; border: 2px solid #ff9f1c; background: white;
  color: #ff9f1c; border-radius: 0.5rem; cursor: pointer; font-size: 1rem;
}
.tab.active { background: #ff9f1c; color: white; }

.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-form input {
  padding: 0.75rem; font-size: 1rem; border: 1px solid #ddd; border-radius: 0.5rem;
}
.auth-form button {
  padding: 0.75rem; background: #ff9f1c; color: white; border: none;
  border-radius: 0.5rem; font-size: 1rem; cursor: pointer; margin-top: 0.5rem;
}
.auth-error { color: #c00; font-size: 0.9rem; min-height: 1.2rem; }

/* MAIN */
header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
header h1 { font-size: 1.5rem; }
.header-actions { display: flex; gap: 0.5rem; }
.header-actions button {
  background: #ff9f1c; color: white; border: none;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; cursor: pointer;
  font-size: 1.2rem;
}

.welcome { color: #888; margin-bottom: 1.5rem; }

#recettes-list { display: grid; gap: 1rem; }

.recette {
  background: var(--couleur, #888);
  color: white; padding: 1.2rem; border-radius: 1rem;
  position: relative;
}
.recette h2 { margin-bottom: 0.5rem; }
.recette .type { font-style: italic; opacity: 0.9; }
.recette .temps { margin-top: 0.5rem; font-size: 0.9rem; }
.recette-actions {
  position: absolute; top: 0.5rem; right: 0.5rem; display: flex; gap: 0.25rem;
}
.recette-actions button {
  background: rgba(0,0,0,0.2); border: none; color: white;
  width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer;
}

.vide, .erreur { text-align: center; padding: 3rem; color: #888; }
.erreur { color: #c00; }

#btn-add {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 4rem; height: 4rem; border-radius: 50%;
  background: #ff9f1c; color: white; border: none;
  font-size: 2rem; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* DIALOGS */
dialog {
  border: none; border-radius: 1rem; padding: 0;
  width: 90%; max-width: 500px; max-height: 85vh;
}
dialog::backdrop { background: rgba(0,0,0,0.5); }

dialog header { padding: 1rem; border-bottom: 1px solid #eee; }
dialog header button {
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #666;
}

#form-recette { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }
#form-recette label {
  display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: #666;
}
#form-recette input, #form-recette select, #form-recette textarea {
  padding: 0.6rem; border: 1px solid #ddd; border-radius: 0.5rem; font-size: 1rem;
  font-family: inherit;
}
#form-recette button[type="submit"] {
  padding: 0.75rem; background: #ff9f1c; color: white; border: none;
  border-radius: 0.5rem; font-size: 1rem; cursor: pointer; margin-top: 0.5rem;
}

/* CHAT */
#dialog-claude { height: 80vh; display: flex; flex-direction: column; }
#chat {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.msg { padding: 0.6rem 0.9rem; border-radius: 1rem; max-width: 80%; }
.msg.user { background: #ff9f1c; color: white; align-self: flex-end; }
.msg.claude { background: #f0f0f0; align-self: flex-start; }
.msg.loading { opacity: 0.6; font-style: italic; }
.msg.erreur { background: #ffd6d6; color: #c00; }

#form-claude {
  display: flex; gap: 0.5rem; padding: 1rem; border-top: 1px solid #eee;
}
#input-claude {
  flex: 1; padding: 0.6rem; border: 1px solid #ddd;
  border-radius: 0.5rem; font-size: 1rem;
}
#form-claude button {
  background: #ff9f1c; color: white; border: none;
  padding: 0.6rem 1rem; border-radius: 0.5rem; cursor: pointer;
}