/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Design Tokens ===== */
:root {
  --color-cta: #F5A623;
  --color-cta-hover: #e69514;
  --color-cta-green: #28a745;
  --color-cta-green-hover: #218838;
  --color-text: #333;
  --color-text-muted: #666;
  --color-bg: #fff;
  --color-border: #ddd;
  --max-width: 430px;
  --header-height: 56px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --transition: 0.2s ease;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: var(--shadow);
  z-index: 100;
  overflow: hidden;
}

.header--golden {
  background: linear-gradient(180deg, #d4a84b 0%, #c49a3d 50%, #b89235 100%);
}

body[data-current-view="view-pix"] .header,
.header--green {
  background: linear-gradient(180deg, #28a745 0%, #218838 50%, #1e7e34 100%) !important;
}

.header__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* ===== Main & Views ===== */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: var(--header-height);
  flex: 1;
  width: 100%;
}

body[data-current-view="view-welcome"] .main {
  background-color: #2a1f14;
}

.view {
  display: none;
  padding: 1rem;
  padding-bottom: 2rem;
  animation: fadeIn 0.3s ease;
}

.view.view--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== CTA Buttons ===== */
.btn-cta {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--color-cta);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  text-align: center;
}

.btn-cta:hover {
  background: var(--color-cta-hover);
}

.btn-cta--small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-cta--green {
  background: var(--color-cta-green);
  color: #fff;
}

.btn-cta--green:hover {
  background: var(--color-cta-green-hover);
}

/* ===== Footer ===== */
.footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, #8b6914 0%, #6b4423 50%, #5c3d1f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 -2px 8px rgba(0, 0, 0, 0.15);
}

/* ===== Welcome View ===== */
#view-welcome.view--active {
  padding-bottom: 0;
  background-color: #2a1f14;
}

#view-welcome .welcome {
  margin-bottom: -1rem;
}

.welcome {
  position: relative;
  min-height: calc(100vh - var(--header-height) - 3.5rem);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-color: #2a1f14;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  margin: 0 -1rem;
}

.welcome__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 0.8) 100%);
  pointer-events: none;
}

.welcome__content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.welcome__title {
  font-size: 1.5rem;
  margin: 0;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.welcome__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.welcome .btn-cta {
  margin-top: 0.5rem;
}

/* ===== Chat View ===== */
.chat {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat__messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
}

.chat__message {
  max-width: 85%;
  padding: 1rem;
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.chat__message--agent {
  align-self: flex-start;
  background: #f0f0f0;
  color: var(--color-text);
}

.chat__message--user {
  align-self: flex-end;
  background: var(--color-cta);
  color: #000;
}

.chat__message p {
  margin: 0;
}

.chat__input-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat__input-area input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.chat__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chat__quick-reply {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.chat__quick-reply:hover {
  background: #eee;
}

.chat__actions {
  margin-top: 1rem;
}

.chat__audio-section {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.chat__recording-text {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.chat__audio-btn {
  padding: 0.6rem 1.25rem;
  background: #4a4a4a;
  color: #fff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.chat__audio-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.chat__audio-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* WhatsApp-style audio player */
.chat__audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f0f0f0;
  border-radius: 12px;
  max-width: 85%;
}

.chat__audio-play-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-cta-green);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  position: relative;
}

.chat__audio-play-btn:hover {
  background: var(--color-cta-green-hover);
}

.chat__audio-play-btn .chat__audio-icon {
  position: absolute;
}

.chat__audio-icon {
  width: 20px;
  height: 20px;
}

.chat__audio-progress-wrap {
  flex: 1;
  min-width: 0;
}

.chat__audio-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.chat__audio-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-cta-green);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.chat__audio-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.chat__kit-image {
  align-self: flex-start;
  flex-shrink: 0;
  margin: 0.25rem 0 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 85%;
  width: 100%;
}

.chat__kit-image img {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Typing indicator */
.chat__typing {
  align-self: flex-start;
  padding: 1rem 1.25rem;
  background: #f0f0f0;
  border-radius: var(--radius);
}

.chat__typing-dots {
  display: flex;
  gap: 4px;
}

.chat__typing-dots span {
  width: 8px;
  height: 8px;
  background: #888;
  border-radius: 50%;
  animation: chatTypingBounce 1.4s ease-in-out infinite both;
}

.chat__typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat__typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatTypingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== Kit View ===== */
.kit {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.kit__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  text-align: center;
}

.kit__attention {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
}

.kit__product {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.kit__image {
  width: 100%;
  object-fit: contain;
  background: #faf8f5;
}

.kit__label {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.9rem;
  border-radius: 4px;
}

.kit__section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.kit__list {
  margin: 0;
  padding-left: 1.25rem;
}

.kit__list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.btn-cta--with-icon {
  /* Same as btn-cta, icon via emoji in text */
}

.kit__testimonial-intro {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.kit__testimonial-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.kit__testimonial-card-img {
  width: 100%;
  display: block;
}

.kit__cta-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

/* ===== Personal Data View ===== */
.personal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.personal__banner {
  padding: 0.5rem;
  background: var(--color-cta);
  color: #000;
  text-align: center;
  font-weight: 700;
  border-radius: var(--radius);
}

.personal__title {
  font-size: 1.1rem;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}

.personal__progress {
  display: flex;
  gap: 1rem;
  justify-content: center;
  font-size: 0.9rem;
}

.personal__step {
  color: var(--color-text-muted);
}

.personal__step--active {
  color: var(--color-text);
  font-weight: 700;
}

.personal__welcome {
  margin: 0;
  color: var(--color-text-muted);
}

.personal__form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.personal__form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.personal__step-content--hidden {
  display: none !important;
}

.personal__info {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===== Donation View ===== */
.donation {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
  padding: 1rem 0;
}

.donation__text {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ===== Contribution View ===== */
.contribution {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contribution__title {
  font-size: 1.25rem;
  margin: 0;
  text-align: center;
}

.contribution__subtitle {
  margin: 0;
  text-align: center;
  color: var(--color-text-muted);
}

.contribution__amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.contribution__btn {
  padding: 1rem;
  background: #f5f5f5;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.contribution__btn:hover,
.contribution__btn.contribution__btn--selected {
  border-color: var(--color-cta);
  background: rgba(245, 166, 35, 0.15);
}

.contribution__custom label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.contribution__custom input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.contribution__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.contribution__desc + .contribution__desc {
  margin-top: 0.75rem;
}

.contribution__image {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ===== PIX View ===== */
.pix {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
}

.pix__title {
  font-size: 1.25rem;
  margin: 0;
}

.pix__text {
  margin: 0;
}

.pix__qr {
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.pix__qr img {
  width: 200px;
  height: 200px;
}

.pix__mobile {
  text-align: left;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: var(--radius);
}

.pix__mobile p {
  margin: 0 0 0.5rem;
}

.pix__mobile p:last-child {
  margin-bottom: 0;
}

.pix__demo {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.pix__demo-link {
  color: var(--color-cta);
  text-decoration: underline;
}

.pix__demo-link:hover {
  color: var(--color-cta-hover);
}

.pix__status {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* ===== Modal (CPF) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s ease;
}
.modal.modal--open {
  visibility: visible;
  opacity: 1;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}
.modal__text {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}
.modal__form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.modal__form input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-sizing: border-box;
}
.modal__error {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #c00;
}
.modal__error:empty {
  display: none;
}
.modal__form button {
  width: 100%;
  margin-top: 0.5rem;
}

/* Donation popup (Figma-style) */
.modal--donation .modal__overlay {
  background: rgba(0, 0, 0, 0.6);
}

.modal__box--donation {
  padding: 1.5rem 1.5rem 1.75rem;
  max-width: 340px;
}

.modal__donation-label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
}

.modal__title--donation {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 1.5rem;
}

.btn-cta--gradient {
  background: linear-gradient(90deg, #F5A623 0%, #e69514 100%);
  color: #000;
  font-weight: 700;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-cta--gradient:hover {
  opacity: 0.95;
}

/* ===== Video Offer View ===== */
.video-offer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
  padding: 2rem 0;
}

.video-offer__text {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* ===== Appointment View ===== */
.appointment {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appointment__intro {
  margin: 0;
}

.appointment__title {
  font-size: 1.2rem;
  margin: 0;
}

.appointment__subtitle {
  margin: 0;
  color: var(--color-text-muted);
}

.appointment__form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.appointment__form input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.appointment__times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.appointment__time {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border: 2px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.appointment__time:hover {
  background: #eee;
}

.appointment__time--available {
  border-color: var(--color-cta-green);
  color: var(--color-cta-green);
}

.appointment__time--available:hover,
.appointment__time.appointment__time--selected {
  background: rgba(40, 167, 69, 0.15);
}

.appointment__time:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.appointment__fee {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ===== Responsive ===== */
@media (min-width: 431px) {
  .main {
    box-shadow: 0 0 0 1px var(--color-border);
  }
}
