/* =========================================================
   How Do I Say? – Rafa's Club
   Brandbook: azul-caribe base, coral vivo accent,
   mostarda-poente support, Fraunces + Quicksand.
   ========================================================= */

:root {
  /* Brand palette (Rafa's Club brandbook) */
  --azul-caribe: #0B5D6B;
  --azul-noite: #0B2A30;
  --coral-vivo: #D94F4F;
  --coral-claro: #E85D5D;
  --mostarda: #F2A154;
  --areia: #F5B36B;
  --cream: #F6EFDC;
  --cream-dim: #E4DCC7;

  /* Semantic mapping */
  --bg: var(--azul-caribe);
  --surface: var(--cream);
  --surface-soft: #FBF7EC;
  --ink: var(--azul-noite);
  --ink-soft: #4C6E74;
  --border: rgba(11, 42, 48, 0.14);
  --accent: var(--coral-vivo);
  --accent-dark: #B93A3A;
  --success: #1E8F6F;
  --success-soft: #DCEFE7;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 100px;
  --shadow: 0 1px 2px rgba(11, 42, 48, .12), 0 6px 20px rgba(11, 42, 48, .16);
  --max-width: 560px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 0%, rgba(255,255,255,0.05), transparent 55%);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 20px 32px;
}

/* ===================== HEADER ===================== */

.app-header {
  padding: 22px 0 8px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--cream);
  opacity: 0.9;
}

.logo-til {
  color: var(--coral-vivo);
  margin-left: 1px;
}

/* ===================== MAIN ===================== */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===================== HERO / SEARCH ===================== */

.hero {
  padding: 18px 0 6px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.15;
  color: var(--cream);
}

.hero-subtitle {
  font-family: var(--font-body);
  color: var(--cream-dim);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 26px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 17px 18px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s ease;
}

.search-input::placeholder {
  color: var(--ink-soft);
  opacity: 0.65;
  font-weight: 500;
}

.search-input:focus {
  outline: none;
  border-color: var(--coral-vivo);
}

.btn {
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, opacity .15s ease;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  width: 100%;
  background: var(--coral-vivo);
  color: var(--cream);
  font-size: 1rem;
  padding: 17px;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(217, 79, 79, 0.35);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

/* Suggestions */

.suggestions {
  margin-top: 20px;
}

.suggestions-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cream-dim);
  opacity: 0.8;
  margin-bottom: 10px;
}

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

.suggestion-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.suggestion-chip:hover {
  border-color: var(--mostarda);
  color: var(--areia);
}

/* Surprise button */

.btn-surprise {
  margin-top: 22px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cream);
  font-size: 0.95rem;
  padding: 15px;
}

.btn-surprise:hover {
  border-color: var(--mostarda);
  color: var(--areia);
}

/* ===================== CATEGORIES ===================== */

.categories {
  margin-top: 30px;
}

.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--cream-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}

.category-chip:hover {
  border-color: var(--mostarda);
  color: var(--cream);
}

.category-chip.active {
  background: var(--coral-vivo);
  border-color: var(--coral-vivo);
  color: var(--cream);
}

/* ===================== RESULTS ===================== */

.results {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-level {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: rgba(11, 42, 48, 0.07);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.result-block {
  margin-bottom: 16px;
}

.result-block:last-of-type {
  margin-bottom: 0;
}

.result-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.result-pt {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0;
}

.result-en {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.icon-btn {
  flex: 1;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.icon-btn:hover {
  border-color: var(--coral-vivo);
}

.icon-btn.copied {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.alternatives {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

.alternatives-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.alternatives-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alternatives-list li {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  padding-left: 16px;
  position: relative;
}

.alternatives-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--mostarda);
}

.why-toggle {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--coral-vivo);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.why-toggle:hover {
  color: var(--accent-dark);
}

.why-box {
  margin-top: 12px;
  background: rgba(242, 161, 84, 0.16);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.5;
  display: none;
}

.why-box.visible {
  display: block;
}

/* No results */

.no-result-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
}

.no-result-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cream);
  margin: 0 0 6px;
}

.no-result-subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cream-dim);
  margin: 0 0 18px;
}

.no-result-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Category browse list (multiple results when browsing a category) */

.category-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cream);
  margin: 4px 0 2px;
}

/* ===================== FOOTER ===================== */

.app-footer {
  text-align: center;
  padding: 30px 0 4px;
}

.app-footer p {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--cream-dim);
  opacity: 0.75;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.app-footer a {
  color: var(--areia);
  font-weight: 700;
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--coral-vivo);
  text-decoration: underline;
}

.app-footer .ai-note {
  font-size: 0.66rem;
  opacity: 0.5;
  font-weight: 500;
}

/* ===================== RESPONSIVE ===================== */

@media (min-width: 640px) {
  :root { font-size: 17px; }
  .app { padding: 0 32px 40px; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 1.8rem; }
  .result-en { font-size: 1.3rem; }
}
