/* Configuracao visual base do aplicativo */
:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-strong: #ecfdf3;
  --text: #152016;
  --muted: #647067;
  --brand: #16a34a;
  --brand-dark: #13833d;
  --danger: #dc2626;
  --border: #dce5dc;
  --shadow: 0 16px 40px rgba(21, 32, 22, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e9f7ee 0%, var(--bg) 36%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

/* Container principal mobile first */
.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.app-mark {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.32);
}

/* Cards de resumo das calorias */
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.summary-card-primary {
  background: var(--surface-strong);
  border-color: #b7e9c7;
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: clamp(1.45rem, 9vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

/* Blocos de formulario e lista */
.panel {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdfb;
  color: var(--text);
  outline: none;
  padding: 12px 14px;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.food-form {
  display: grid;
  gap: 14px;
}

.suggestions-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.suggestions-list:empty {
  display: none;
}

.suggestion-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cfe7d5;
  border-radius: 14px;
  background: #f4fbf6;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.suggestion-button strong {
  overflow-wrap: anywhere;
}

.suggestion-button span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.food-form button {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.food-form button:active {
  transform: translateY(1px);
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.list-heading h2 {
  margin-bottom: 0;
}

.ghost-button {
  border: 0;
  border-radius: 999px;
  background: #eef5ef;
  color: var(--brand-dark);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.empty-state {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.food-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.food-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfdfb;
  padding: 12px;
}

.food-item strong {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.food-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.remove-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fee2e2;
  color: var(--danger);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

/* Ajustes para telas um pouco maiores */
@media (min-width: 700px) {
  body {
    display: grid;
    align-items: start;
  }

  .app-shell {
    padding-top: 44px;
  }
}
