/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS — Dra. Amanda Garcia
═══════════════════════════════════════════════════════════════ */
:root {
  --color-petrol: #0D3B5E;
  --color-navy: #0A2A45;
  --color-navy-deep: #071E33;
  --color-gold: #C9A84C;
  --color-gold-lt: #D4B86A;
  --color-cream: #F5EFE0;
  --color-cream-lt: #FAF6EE;
  --color-white: #FFFFFF;
  --color-teal-btn: #1A5C6E;
  --color-teal-hover: #154D5D;
  --color-text-dark: #1A2A3A;
  --color-text-mid: #3A5068;
  --color-text-muted: #6B8BA4;

  --radius-card: 18px;
  --radius-modal: 20px;
  --radius-btn: 50px;
  --radius-input: 10px;

  --shadow-card: 0 4px 24px rgba(10, 42, 69, .18), 0 1px 4px rgba(10, 42, 69, .12);
  --shadow-modal: 0 8px 48px rgba(5, 20, 40, .35);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;

  --transition: 0.3s cubic-bezier(.4, 0, .2, 1);
  --max-width: 520px;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-white);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: #013254;
}

@media (min-width: 521px) {
  body {
    background: linear-gradient(to bottom, #FAF6EE 0px, #FAF6EE 260px, #013254 360px, #01365A 100%);
  }
}

.page-wrapper {
  max-width: var(--max-width);
  margin-inline: auto;
  width: 100%;
  min-height: 100vh;
  position: relative;
  background-color: #01365A;
  background-image: url('assets/fundo.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
}

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

button {
  cursor: pointer;
  font-family: var(--font-sans);
}

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

/* ═══════════════════════════════════════════════════════════════
   LAYOUT WRAPPER
═══════════════════════════════════════════════════════════════ */
.site-header,
.cards-section,
.site-footer {
  max-width: var(--max-width);
  margin-inline: auto;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.site-header {
  position: relative;
  padding-top: 0;
}

.header-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0 0 0 0;
  object-fit: cover;
  /* Priority load */
}

/* Welcome bar */
.welcome-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 14px;
  justify-content: center;
}

.welcome-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  max-width: 80px;
}

.welcome-text {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--color-gold-lt);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS SECTION
═══════════════════════════════════════════════════════════════ */
.cards-section {
  padding: 6px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 21px;
  width: 100%;
}

.card-wrapper {
  width: 100%;
  max-width: 470px;
  margin-inline: auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.card-link {
  display: block;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.card-btn:focus-visible,
.card-link:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

@media (hover: hover) {
  .card-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 36px rgba(10, 42, 69, .28);
  }

  .card-btn:active {
    transform: translateY(-1px);
  }
}

.card-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.site-footer {
  padding: 12px 24px 28px;
  text-align: center;
}

.footer-social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.social-icon-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38), 0 2px 5px rgba(0, 0, 0, 0.22);
}

.social-icon-btn:active {
  transform: translateY(0) scale(0.98);
}

.social-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 50%;
  border: none;
}

.footer-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-divider::before,
.footer-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold) 50%, transparent);
  max-width: 70px;
}

.footer-tooth {
  width: 26px;
  height: 30px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  opacity: 1;
  background: transparent;
  filter: none;
  -webkit-mask: none;
  mask: none;
}

.footer-text {
  font-size: .70rem;
  color: rgba(255, 255, 255, .6);
  letter-spacing: .03em;
}

.footer-link {
  color: var(--color-gold-lt);
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition), opacity var(--transition);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-white);
  opacity: 0.95;
}

.footer-link:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 18, 35, .82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overscroll-behavior: contain;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.modal-overlay.is-animating {
  display: flex;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL CONTAINER
═══════════════════════════════════════════════════════════════ */
.modal-container {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-modal);
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 90dvh);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-modal);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.3s cubic-bezier(.16, 1, .3, 1);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) transparent;
}

.modal-overlay.is-open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-container::-webkit-scrollbar {
  width: 4px;
}

.modal-container::-webkit-scrollbar-track {
  background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL CLOSE BUTTON
═══════════════════════════════════════════════════════════════ */
.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  z-index: 10;
  background: rgba(255, 255, 255, .9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-petrol);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 12px -36px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--color-petrol);
  color: var(--color-white);
}

.modal-close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL — FORM (Agendamento)
═══════════════════════════════════════════════════════════════ */
.modal-form-container {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  max-height: 90vh;
  overflow: hidden;
}

.modal-form-header {
  flex-shrink: 0;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(200, 168, 76, .2);
}

.modal-form-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 24px 20px;
}

.modal-form-body::-webkit-scrollbar {
  width: 4px;
}

.modal-form-body::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 4px;
}

.modal-sticky-footer {
  flex-shrink: 0;
  background: var(--color-white);
  padding: 12px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(200, 168, 76, .2);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.form-progress-bar {
  height: 3px;
  background: rgba(200, 168, 76, .2);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.form-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-lt));
  border-radius: 3px;
  width: 25%;
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}

.form-step-label {
  font-size: .72rem;
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--color-petrol);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: .85rem;
  color: var(--color-text-mid);
  line-height: 1.5;
}

/* Schedule Form */
.schedule-form {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Form Fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(.4, 0, .2, 1),
    opacity 0.35s ease,
    margin-top 0.35s ease;
}

.form-field.visible {
  max-height: 160px;
  opacity: 1;
  margin-top: 16px;
}

.form-field.hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.form-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--color-text-dark);
  display: block;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #DDE5ED;
  border-radius: var(--radius-input);
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--color-text-dark);
  background: var(--color-cream-lt);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
}

.form-input.input-error {
  border-color: #E05A5A;
  box-shadow: 0 0 0 3px rgba(224, 90, 90, .12);
}

.form-input.input-valid {
  border-color: #2E9E6B;
}

.field-hint {
  font-size: .77rem;
  color: #E05A5A;
  min-height: 1.1em;
}

.field-hint.valid {
  color: #2E9E6B;
}

/* Número sem spinners */
input[type=number] {
  -moz-appearance: textfield;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Serviço Options */
.servico-fieldset {
  border: none;
  padding: 0;
}

.servico-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.servico-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  min-height: 44px;
  border: 1.5px solid #DDE5ED;
  border-radius: 10px;
  background: var(--color-cream-lt);
  font-size: .75rem;
  font-weight: 500;
  color: var(--color-text-mid);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
  word-break: break-word;
}

.servico-btn:hover {
  border-color: var(--color-gold);
  background: rgba(201, 168, 76, .06);
}

.servico-btn.selected,
.servico-btn[aria-pressed="true"] {
  border-color: var(--color-teal-btn);
  background: rgba(26, 92, 110, .08);
  color: var(--color-teal-btn);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--color-teal-btn);
}

/* WhatsApp Button — Fixo no rodapé do modal */
.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  background-color: #25D366;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 14px rgba(37, 211, 102, .3);
  -webkit-tap-highlight-color: transparent;
}

.whatsapp-btn:hover:not(:disabled) {
  background-color: #20BD5A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
}

.whatsapp-btn:active:not(:disabled) {
  transform: translateY(0);
}

.whatsapp-btn:disabled,
.whatsapp-btn[aria-disabled="true"] {
  background-color: #8DE0A6;
  color: #FFFFFF;
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wa-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL — PORTFOLIO
═══════════════════════════════════════════════════════════════ */
.modal-portfolio-container {
  padding: 0 0 20px;
}

.portfolio-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(200, 168, 76, .2);
}

.modal-portfolio-container .modal-title {
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   CAROUSEL
═══════════════════════════════════════════════════════════════ */
.carousel {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.carousel-track-wrapper {
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  position: relative;
  list-style: none;
}

.carousel-slide img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--color-cream);
  display: block;
}

.carousel-slide-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-cream-lt) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-muted);
}

.carousel-slide-placeholder svg {
  opacity: .4;
}

/* Nav buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13, 59, 94, .75);
  border: 1.5px solid rgba(201, 168, 76, .4);
  color: var(--color-white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background var(--transition), transform var(--transition);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: var(--color-petrol);
  transform: translateY(-50%) scale(1.08);
}

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

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

/* Footer: dots + counter */
.carousel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px 4px;
}

.carousel-dots {
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(201, 168, 76, .3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}

.carousel-dot.active {
  background: var(--color-gold);
  transform: scale(1.25);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.carousel-counter {
  font-size: .78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 36px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════ */
.site-header {
  animation: fadeSlideDown 0.7s ease both;
}

.card-animate {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.card-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .site-header,
  .card-animate,
  .carousel-track,
  .form-field,
  .modal-container,
  .modal-overlay,
  .form-progress-fill,
  .card-btn {
    animation: none !important;
    transition: none !important;
  }

  .card-animate {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .welcome-text {
    font-size: .58rem;
    letter-spacing: .12em;
  }

  .cards-section {
    padding: 4px 10px 20px;
    gap: 12px;
  }

  .servico-options {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 520px) {
  :root {
    --max-width: 520px;
  }

  .cards-section {
    padding: 8px 0 32px;
  }

  .site-footer {
    padding: 16px 0 36px;
  }

  .welcome-bar {
    padding: 18px 0 10px;
  }
}

@media (min-width: 768px) {
  .welcome-text {
    font-size: .7rem;
  }

  .modal-title {
    font-size: 1.6rem;
  }
}

/* Body lock when modal open — iOS-compatible */
body.modal-open {
  overflow: hidden;
  /* position: fixed causa jump de scroll no iOS — usamos top dinâmico via JS */
  width: 100%;
  height: 100%;
}