body {
    background: linear-gradient(120deg, #faeed3 0%, #d4fc79 100%);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
}
.app-container {
    max-width: 1000px;
    margin: 50px auto 20px auto;
    background: #fff8ec;
    border-radius: 22px;
    box-shadow: 0 8px 32px 0 rgba(111, 132, 75, 0.10);
    padding: 2.3em 2em 2em 2em;
    text-align: center;
    width: 96%;
}
h1 {
    margin-bottom: 0.2em;
}
p, .notice, .footer {
    font-size: 1.05em;
}
form {
    margin-bottom: 1.3em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}
input[type="file"],
input[type="password"] {
    font-size: 1em;
    border-radius: 8px;
    border: 1.5px solid #eeeeee;
    padding: 10px;
    margin-top: 0.2em;
    width: 100%;
    box-sizing: border-box;
    max-width: 330px;
}
input[type="password"] {
    border: 1.5px solid #cbea7b;
    margin-bottom: 0.2em;
}
button {
    background: linear-gradient(90deg, #75d055, #20e2a8);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 16px 0;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
    width: 100%;
    max-width: 330px;
    box-sizing: border-box;
}
button:hover {
    background: linear-gradient(90deg, #2ebf91, #75d055);
}
#result {
    margin-top: 22px;
    padding: 1.1em;
    background: #f6ffd5;
    border-radius: 10px;
    word-break: break-word;
    min-height: 50px;
    transition: background 0.2s;
}
.notice {
    color: #6d8468;
    margin-top: 24px;
    margin-bottom: 12px;
}
.footer {
    color: #90b47a;
    margin-top: 18px;
    font-size: 0.97em;
}
img.analysis-preview {
    max-width: 420px;
    width: 100%;
    border-radius:12px;
    margin-bottom:8px;
    height: auto;
    box-shadow: 0 2px 13px #eaf7e0cc;
}

.result-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: stretch;
  margin-top: 10px;
  animation: fadein 0.7s;
  justify-content: flex-start;
}

.result-card {
  background: #fffefa;
  border-radius: 13px;
  box-shadow: 0 2px 13px #cbeaa188, 0 0.5px 1.5px #b2ddb366;
  padding: 1em 1.2em 0.85em 1.2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 1.07em;
  font-weight: 480;
  min-height: 0;
  min-width: 180px;
  max-width: 315px;
  flex: 1 1 210px;
  transition: box-shadow 0.28s;
}
.result-card .icon-card {
  font-size:2em;
  margin-bottom: 7px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-title {
  font-weight: 600; color: #34740d; margin-bottom: 3px; margin-top: 2px;
}
.result-card.fit {
  border-left: 5px solid #79e37c;
  background: linear-gradient(90deg,#eefeed 70%,#f9fff4);
}
.result-card.diet {
  border-left: 5px solid #ffc977;
  background: linear-gradient(90deg,#fff9ed 60%,#fcffe4);
}
.result-card.healthy {
  border-left: 5px solid #afd7a9;
}
.result-card.error {
  border-left: 5px solid #d52d2d; color:#940;
  background: #fff3f1;
}
.r-macros {
  margin-top: 1px;
  font-size: 0.99em;
  color: #127398;
}
.r-macros strong { color: #266096; }
.r-ingredients {
  margin: 1px 0 0.2em 0.5em; font-size: 0.99em;
}
@media (max-width: 600px) {
  .result-cards { gap: 8px; }
  .result-card { padding: 0.85em 0.2em 0.8em 0.45em; font-size: 1em;}
  .result-card .icon-card {font-size: 1.29em; width:2em;}
  .card-title { font-size: 1em;}
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: none; }
}
hr {
    margin: 1em 0;
    border: 0;
    border-top: 1px solid #e1efb6;
}


.lang-switcher {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  margin-bottom: 18px;
  width: 100px;
  min-width: 82px;
}
.flag-btn {
  background: white;
  color: #444;
  border: 2px solid #e1efb6;
  border-radius: 10px;
  padding: 6px 15px 6px 6px;
  font-size: 1.06em;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(131, 197, 107, 0.09);
  transition: background 0.2s, border-color 0.18s, box-shadow 0.17s, color 0.2s;
  outline: none;
}
.flag-img {
  display: inline-block;
  vertical-align: middle;
  border-radius: 3px;
  margin-right: 7px;
  box-shadow: 0 1.5px 6px #e8eddf88;
}
.flag-btn.active,
.flag-btn:focus {
  border: 2.5px solid #76d24c;
  box-shadow: 0 3px 12px rgba(89, 191, 58, 0.19);
  background: linear-gradient(87deg, #eaffd4 70%, #f3f7e7 100%);
  color: #295d11;
}
.flag-btn:hover:not(.active) {
  border-color: #addb7c;
  background: #fbffef;
}

@media (max-width: 900px) {
  .result-cards {
    gap: 12px;
  }
  .result-card { max-width: 98vw; min-width: 0; }
}
@media (max-width: 600px) {
  .app-container {
    margin: 14px 4px;
    padding: 1.2em 6px 1.3em 6px;
    border-radius: 14px;
    max-width: 99vw;
  }
  h1 { font-size: 1.3em; }
  #result { font-size: 1em; }
  form { gap: 11px; }
  .lang-switcher { justify-content: flex-start; }
  .result-cards {
    flex-direction: column;
    gap: 10px;
  }
  .result-card {
    flex: auto;
    min-width: 0;
    max-width: 99vw;
    min-height: 0;
    font-size: 0.99em;
    padding: 0.85em 0.2em 0.8em 0.45em;
    align-items: center;
  }
  .result-card .icon-card {
    margin-bottom: 2px;
    font-size: 1.35em;
    margin-top: 0;
  }
  .card-title { font-size: 1em;}
}

@media (max-width: 400px) {
  h1 { font-size: 1.05em; }
  .app-container { padding: 4vw 2vw; }
  #result { font-size: 0.98em; }
}
