/* ==========================================================================
   Voto Sincero — estilos globais
   Paleta verde, cartões estilo "Duolingo", layout mobile-first responsivo.
   ========================================================================== */

:root {
  --green-900: #063d26;
  --green-800: #0a5c37;
  --green-700: #0f7a44;
  --green-600: #14914f;
  --green-500: #1aa85a;
  --green-400: #2ec46f;
  --green-300: #7fdb9e;
  --green-100: #e3f8ea;
  --green-050: #f5faf6;

  --yellow-500: #ffc93c;
  --yellow-600: #f2ac1f;

  --ink-900: #16261f;
  --ink-700: #33443c;
  --ink-500: #5c6b63;
  --ink-300: #93a39a;

  --white: #ffffff;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-card: 0 2px 0 rgba(6, 61, 38, 0.08), 0 6px 16px rgba(6, 61, 38, 0.06);

  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--green-050) 0%, #eef9f1 100%);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button {
  font-family: inherit;
}

a {
  color: var(--green-700);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------------------------- Header ---------------------------------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 250, 246, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--green-800);
  font-size: 15px;
  letter-spacing: 0.2px;
}

.app-header-brand img {
  display: block;
  border-radius: 8px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  border: none;
  background: var(--white);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* ---------------------------------- Main / transitions ---------------------------------- */

.app-main {
  flex: 1;
  position: relative;
  padding: 6px 18px 28px;
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  will-change: transform, opacity;
}

.app-main.exit-left {
  transform: translateX(-28px);
  opacity: 0;
}

.app-main.exit-right {
  transform: translateX(28px);
  opacity: 0;
}

.app-main.enter-right {
  transform: translateX(28px);
  opacity: 0;
}

.app-main.enter-left {
  transform: translateX(-28px);
  opacity: 0;
}

.app-main.enter-active {
  transform: translateX(0);
  opacity: 1;
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 140px);
}

/* ---------------------------------- Buttons (estilo Duolingo) ---------------------------------- */

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 16px;
  padding: 15px 22px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  letter-spacing: 0.2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--green-500);
  color: var(--white);
  box-shadow: 0 4px 0 var(--green-700);
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--green-700);
}

.btn-secondary {
  background: var(--white);
  color: var(--green-700);
  box-shadow: 0 4px 0 var(--green-100);
  border: 2px solid var(--green-100);
}

.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--green-100);
}

.btn-outline {
  background: var(--white);
  color: var(--green-700);
  border: 2px solid var(--green-500);
  box-shadow: none;
}

.btn-outline:active {
  transform: translateY(2px);
}

.btn-text {
  background: transparent;
  color: var(--ink-500);
  box-shadow: none;
  text-decoration: underline;
  font-weight: 700;
  padding: 10px 6px;
  align-self: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---------------------------------- Home ---------------------------------- */

.screen-home {
  justify-content: space-between;
  padding-top: 24px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-top: 8vh;
}

.home-logo {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 4px;
}

.home-title {
  font-size: 26px;
  line-height: 1.25;
  margin: 0;
  color: var(--green-900);
  font-weight: 800;
}

.home-subtitle {
  font-size: 16px;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.5;
  max-width: 40ch;
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 12px;
}

.home-note {
  font-size: 13px;
  color: var(--ink-300);
  text-align: center;
  margin: 0;
}

/* ---------------------------------- Toast de instalação (PWA) ---------------------------------- */

.install-toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: calc(100% - 32px);
  max-width: 500px;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 12px 12px 14px;
  box-shadow: 0 12px 28px rgba(6, 61, 38, 0.2), var(--shadow-card);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.install-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.install-toast-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.install-toast-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-500);
}

.install-toast-text strong {
  display: block;
  font-size: 14px;
  color: var(--green-800);
  margin-bottom: 1px;
}

.install-toast-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.install-toast-btn {
  border: none;
  background: var(--green-500);
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--green-700);
  white-space: nowrap;
}

.install-toast-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--green-700);
}

.install-toast-close {
  border: none;
  background: var(--green-100);
  color: var(--ink-700);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  flex: 0 0 auto;
}

@media (max-width: 380px) {
  .install-toast-text {
    display: none;
  }
}

/* ---------------------------------- Quiz ---------------------------------- */

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
}

.progress-track {
  flex: 1;
  height: 12px;
  background: var(--green-100);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-500);
  white-space: nowrap;
}

.quiz-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.quiz-icon {
  font-size: 28px;
  line-height: 1;
}

.quiz-heading h2 {
  margin: 0;
  font-size: 22px;
  color: var(--green-900);
  font-weight: 800;
}

.quiz-instruction-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 18px;
}

.quiz-instruction {
  color: var(--ink-500);
  font-size: 14px;
  margin: 0;
}

.quiz-counter {
  color: var(--green-700);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 2px solid var(--green-100);
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease, background 0.15s ease;
  box-shadow: var(--shadow-card);
}

.option-card:active {
  transform: scale(0.99);
}

.option-card.selected {
  border-color: var(--green-500);
  background: var(--green-100);
}

.option-card.disabled-limit {
  opacity: 0.45;
  cursor: not-allowed;
}

.option-card.disabled-limit:active {
  transform: none;
}

@keyframes card-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.option-card.shake {
  animation: card-shake 0.4s ease;
}

.option-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-card.selected .option-badge {
  background: var(--green-500);
}

.option-text {
  flex: 1;
  margin: 3px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-900);
}

.option-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px;
  white-space: nowrap;
}

.option-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--green-300);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  transition: all 0.15s ease;
}

.option-card.selected .option-check {
  background: var(--green-500);
  border-color: var(--green-500);
  color: var(--white);
}

.quiz-footer {
  margin-top: auto;
  display: flex;
  gap: 12px;
  padding-top: 12px;
}

.quiz-footer .btn-secondary {
  flex: 1;
}

.quiz-footer .btn-primary {
  flex: 2;
}

.empty-note {
  color: var(--ink-300);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

/* ---------------------------------- Modal ---------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 38, 25, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 100;
  padding: 0;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

body.modal-open {
  overflow: hidden;
}

.modal-card {
  background: var(--white);
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform 0.22s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

@media (min-width: 620px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-card {
    border-radius: 20px;
    max-height: 76vh;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.modal-header h3 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  color: var(--green-900);
}

.modal-close {
  border: none;
  background: var(--green-100);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-700);
}

.modal-body p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-700);
  margin: 0;
}

/* ---------------------------------- Resultado ---------------------------------- */

.result-header {
  text-align: center;
  margin: 10px 0 20px;
}

.result-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--green-900);
  font-weight: 800;
}

.result-header p {
  margin: 0;
  color: var(--ink-500);
  font-size: 14px;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
}

.result-card.open {
  border-color: var(--green-300);
}

.result-summary {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.result-summary .result-rank,
.result-summary .result-photo,
.result-summary .result-chevron {
  margin-top: 2px;
}

.result-rank {
  font-weight: 800;
  color: var(--green-700);
  font-size: 14px;
  flex: 0 0 auto;
  width: 26px;
}

.result-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--green-100);
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-info h3 {
  margin: 0 0 2px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink-900);
}

.result-party {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-500);
}

.result-badge {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.result-chevron {
  flex: 0 0 auto;
  font-size: 18px;
  color: var(--ink-300);
  transition: transform 0.2s ease;
}

.result-card.open .result-chevron {
  transform: rotate(180deg);
}

.result-details {
  display: none;
  padding: 0 16px 16px;
  flex-direction: column;
  gap: 12px;
}

.result-card.open .result-details {
  display: flex;
}

.result-match-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.4;
}

.result-match-list strong {
  color: var(--green-800);
}

.farewell-banner {
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  margin: 8px 0 20px;
  box-shadow: var(--shadow-card);
}

.share-cta {
  margin-bottom: 20px;
}

/* ---------------------------------- Mini toast (feedback rápido) ---------------------------------- */

.mini-toast {
  position: fixed;
  top: calc(68px + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -10px);
  max-width: calc(100% - 40px);
  background: var(--ink-900);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.mini-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 20px;
  font-size: 13px;
}

.app-footer a {
  color: var(--ink-500);
  text-decoration: underline;
}

/* ---------------------------------- Imprensa (press release) ---------------------------------- */

.press-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  padding: 4px 0;
}

.press-back:active {
  transform: translateY(1px);
}

.press-tag {
  display: inline-block;
  color: var(--green-700);
  background: var(--green-100);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  margin: 18px 0 12px;
}

.press-dateline {
  color: var(--ink-500);
  font-size: 13px;
  margin: 0 0 6px;
}

.press-headline {
  color: var(--green-900);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 800;
  margin: 0 0 10px;
}

.press-deck {
  color: var(--ink-700);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 22px;
}

.press-lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-900);
  font-weight: 600;
  margin: 0 0 18px;
}

.press-section {
  margin: 0 0 22px;
}

.press-section h2 {
  color: var(--green-800);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 10px;
}

.press-section p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-700);
  margin: 0 0 12px;
}

.press-section p:last-child {
  margin-bottom: 0;
}

.press-quote {
  background: var(--white);
  border-left: 4px solid var(--green-500);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  margin: 0 0 22px;
}

.press-quote p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-900);
  font-style: italic;
}

.press-quote cite {
  display: block;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
  color: var(--green-700);
}

.press-quote cite span {
  display: block;
  font-weight: 500;
  color: var(--ink-500);
  margin-top: 2px;
}

.press-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.press-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.press-feature-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.press-feature p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-700);
}

.press-feature strong {
  color: var(--ink-900);
}

.press-boilerplate {
  background: var(--green-050);
  border: 2px solid var(--green-100);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 0 0 22px;
}

.press-boilerplate h2 {
  color: var(--green-800);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 10px;
}

.press-boilerplate p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-700);
  margin: 0;
}

.press-contact {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin: 0 0 8px;
}

.press-contact h2 {
  color: var(--green-800);
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 10px;
}

.press-contact p {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-700);
}

.press-contact a {
  color: var(--green-700);
  font-weight: 700;
}

.press-end {
  text-align: center;
  color: var(--ink-300);
  letter-spacing: 3px;
  font-weight: 800;
  margin: 6px 0 26px;
}

/* ---------------------------------- Responsivo ---------------------------------- */

@media (min-width: 640px) {
  .app-shell {
    padding-top: 16px;
  }
  .home-title {
    font-size: 30px;
  }
  .option-text {
    font-size: 16px;
  }
  .press-headline {
    font-size: 28px;
  }
}

@media (max-width: 360px) {
  .home-title {
    font-size: 22px;
  }
  .btn {
    font-size: 15px;
    padding: 13px 18px;
  }
}

.home-banner {
  margin: 0 0 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink-100, #eef2ff);
  color: var(--ink-700, #1e293b);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  max-width: 40ch;
}
