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

body {
  font-family: "Segoe UI", sans-serif;
  background: #f7fafc;
  color: #1a202c;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 2rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  background: #fff;
}

header h1 {
  font-size: 2rem;
  color: #2b6cb0;
}

header p {
  color: #718096;
  margin-top: 0.5rem;
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

#models h2 {
  margin-bottom: 1.5rem;
  color: #2c5282;
}

#models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.model-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.model-card h3 {
  color: #2b6cb0;
  margin-bottom: 0.5rem;
}

.model-card p {
  color: #718096;
  font-size: 0.9rem;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.version {
  font-size: 0.75rem;
  color: #276749;
  background: #c6f6d5;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-card {
  font-size: 0.85rem;
  color: #2b6cb0;
  text-decoration: none;
  border: 1px solid #2b6cb0;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-card:hover {
  background: #2b6cb0;
  color: #fff;
}

/* Página do modelo */
.back-link {
  display: inline-block;
  color: #718096;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: #1a202c;
}

.model-page {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.upload-area {
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  background: #fff;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #2b6cb0;
}

.upload-icon {
  font-size: 2.5rem;
}

.upload-placeholder p {
  margin-top: 0.75rem;
  color: #718096;
}

.upload-hint {
  font-size: 0.75rem;
  color: #a0aec0;
  margin-top: 0.5rem;
  display: block;
}

.preview-img {
  max-width: 280px;
  max-height: 280px;
  width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.btn-predict {
  background: #2b6cb0;
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-predict:hover:not(:disabled) {
  background: #2c5282;
}

.btn-predict:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.result-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-box p {
  color: #1a202c;
  font-size: 1rem;
}

.result-confidence {
  color: #718096 !important;
  font-size: 0.85rem !important;
  margin-top: 0.4rem;
}

footer {
  text-align: center;
  padding: 1rem;
  color: #a0aec0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
  background: #fff;
}

/* Link "como foi desenvolvido" no cabeçalho */
.link-sobre {
  display: inline-block;
  margin-top: 0.75rem;
  color: #2b6cb0;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid #2b6cb0;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.link-sobre:hover {
  background: #2b6cb0;
  color: #fff;
}

/* Artigo "bastidores do desenvolvimento" */
.article {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.article-section h2 {
  color: #2c5282;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.article-section p {
  color: #2d3748;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.article-section code {
  background: #edf2f7;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
  color: #276749;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
}

.spec-table th {
  background: #edf2f7;
  color: #2c5282;
  font-weight: 600;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table .row-best td {
  color: #276749;
  font-weight: 600;
}

.article-figure {
  margin: 1.5rem 0;
  text-align: center;
}

.article-figure-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.article-figure-row .article-figure {
  flex: 1 1 0;
  min-width: 0;
}

.article-figure-row .article-figure img {
  width: 100%;
}

@media (max-width: 600px) {
  .article-figure-row {
    flex-direction: column;
  }
}

.article-figure img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.article-figure figcaption {
  margin-top: 0.6rem;
  color: #718096;
  font-size: 0.85rem;
  line-height: 1.5;
}
