@import url("./entrada.css");
@import url("./interpretacao.css");
@import url("./resultado.css");

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #f0f2f6;
  --border: #e3e8ef;
  --text: #0f172a;
  --text-muted: #5b6b7f;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f87171;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

input,
textarea,
select,
button {
  font: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: min(960px, 92vw);
  margin: 0 auto;
}

.page {
  padding: 56px 0 72px;
}

.page__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.page__title {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page__subtitle {
  color: var(--text-muted);
  max-width: 640px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 20px;
}

.field-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-card__label {
  font-weight: 600;
}

.field-card__input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 16px;
  border-radius: 12px;
  min-height: 120px;
  resize: vertical;
}

.field-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: -8px;
  display: none;
}

.field-error.is-visible {
  display: block;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  align-self: flex-start;
}

.btn.is-hidden {
  display: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}

.btn--primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--surface-muted);
  color: var(--text);
}

.btn--ghost:hover {
  background: #e4e9f2;
}

.btn--success {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.btn--success:hover {
  background: rgba(34, 197, 94, 0.24);
}

.btn--danger {
  background: rgba(248, 113, 113, 0.18);
  color: #9f1239;
}

.suggestion {
  border-radius: 14px;
  background: #eef2ff;
  border: 1px dashed rgba(79, 70, 229, 0.3);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.suggestion__icon {
  font-size: 1.2rem;
}

.suggestion__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion__label {
  font-weight: 600;
  color: var(--primary-strong);
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-list__item {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid rgba(245, 158, 11, 0.25);
  cursor: pointer;
  transition: background 0.2s ease;
}

.suggestion-list__item:hover {
  background: #ffedd5;
}

.suggestion-list__item--high {
  background: #dcfce7;
  color: #166534;
  border-color: rgba(22, 101, 52, 0.28);
}

.suggestion-list__item--high:hover {
  background: #bbf7d0;
}

.section-grid {
  display: grid;
  gap: 20px;
}

.section-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.footer {
  margin-top: 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.overlay.is-visible {
  display: flex;
}

.overlay__card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 32px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}

.overlay__carousel {
  width: min(280px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(79, 70, 229, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay__carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.overlay__carousel img.is-visible {
  opacity: 1;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(79, 70, 229, 0.2);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 40px 0 60px;
  }

  .card {
    padding: 20px;
  }
}
