/* p3-ui.css — mapa, menu com submenu, seletor "para quem", modal de aula grátis.
   Carrega depois de blocks.css: sobrescreve sem tocar nos arquivos base. */

/* ---------- 4. Mapa: iframe direto, sem botão ---------- */
.mc-map { min-height: 360px; }
.mc-map .map-preview { z-index: 0; }
.mc-map .map-frame { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; background: var(--color-surface-2); }
.map-load, .map-load-label { display: none !important; } /* legado: o botão "Load map" não existe mais */

/* ---------- 1. Menu com submenu (Programs / About / Explore) ---------- */
.nav-group { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.nav-caret {
  appearance: none; background: transparent; border: 0; padding: 6px 4px; margin: 0; cursor: pointer;
  color: var(--color-gray-300); display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; line-height: 1; transition: color .2s ease;
}
.nav-caret svg { width: 12px; height: 12px; transition: transform .2s ease; }
.nav-caret:hover, .nav-caret:focus-visible { color: #fff; }
.nav-caret:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 2px; }
.nav-group.is-open .nav-caret svg { transform: rotate(180deg); }

/* O submenu é controlado por .is-open (e hover só em mouse); receber foco não abre mais sozinho. */
.nav-group:focus-within .nav-sub { display: none; }
.nav-group.is-open > .nav-sub,
.nav-group.is-open:focus-within > .nav-sub { display: flex; flex-direction: column; }
@media (hover: hover) and (min-width: 769px) {
  .nav-group:hover > .nav-sub { display: flex; flex-direction: column; }
  .nav-group:hover .nav-caret svg { transform: rotate(180deg); }
}
.nav-sub {
  top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: max-content; min-width: 240px; max-width: min(360px, 92vw);
  padding: 8px; gap: 2px; z-index: 50;
  background: linear-gradient(180deg, rgba(30,37,48,.98), rgba(18,22,29,.98));
  border: 1px solid rgba(74,144,217,.28); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
  animation: p3-sub-in .16s ease-out;
}
/* ponte invisível para o mouse não "cair" no vão entre o link e o menu */
.nav-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-sub a {
  white-space: normal; text-wrap: balance; line-height: 1.35; font-size: .8rem; letter-spacing: .02em;
  text-transform: none; padding: 10px 12px; border-radius: 8px; color: var(--color-gray-100);
  border-left: 2px solid transparent; transition: background .15s ease, border-color .15s ease;
}
.nav-sub a:hover, .nav-sub a:focus-visible { background: rgba(74,144,217,.14); border-left-color: var(--color-accent); color: #fff; outline: none; }
@keyframes p3-sub-in { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 768px) {
  .nav-group { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .nav-group > a { flex: 1 1 auto; }
  .nav-caret { padding: 10px 12px; }
  .nav-caret svg { width: 14px; height: 14px; }
  .nav-sub, .nav-group:focus-within .nav-sub { display: none; }
  .nav-group.is-open > .nav-sub, .nav-group.is-open:focus-within > .nav-sub {
    display: flex; position: static; transform: none; animation: none; width: 100%; max-width: none; min-width: 0;
    flex: 1 0 100%; background: transparent; border: 0; border-left: 2px solid rgba(74,144,217,.35); border-radius: 0;
    box-shadow: none; padding: 2px 0 6px 10px; margin: 2px 0 6px 2px;
  }
  .nav-sub::before { display: none; }
}

/* ---------- 2. "Para quem é a aula?" — select estilizado + pills ---------- */
.gd-field select, select[data-pills] {
  width: 100%; padding: 12px 40px 12px 16px; color: var(--color-white); font: inherit; font-size: .95rem;
  background-color: #2a303a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236aabf0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 8px; appearance: none; -webkit-appearance: none; cursor: pointer;
  scrollbar-width: thin; scrollbar-color: var(--color-accent) #2a303a;
}
.gd-field select:focus, select[data-pills]:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-glow); }
.gd-field select option { background: #2a303a; color: #fff; }
.gd-field select::-webkit-scrollbar, select[data-pills]::-webkit-scrollbar { width: 8px; }
.gd-field select::-webkit-scrollbar-track { background: #2a303a; }
.gd-field select::-webkit-scrollbar-thumb { background: var(--color-accent); border-radius: 8px; }

.p3-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.p3-pill {
  appearance: none; flex: 1 1 auto; min-width: 0; padding: 11px 16px; cursor: pointer; text-align: center;
  font: inherit; font-size: .88rem; font-weight: 600; line-height: 1.2; color: var(--color-gray-300);
  background: #2a303a; border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.p3-pill:hover { border-color: var(--color-accent); color: #fff; }
.p3-pill:active { transform: scale(.98); }
.p3-pill[aria-checked="true"] { background: var(--color-accent); border-color: var(--color-accent-light); color: #fff; box-shadow: 0 4px 14px var(--color-accent-glow); }
.p3-pill:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 2px; }
.p3-sr-select { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 3. Modal "Book your free trial" ---------- */
.modal-overlay {
  background: rgba(5,8,12,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 24px; overscroll-behavior: contain;
}
.modal-overlay.active { animation: p3-fade .22s ease-out; }
.modal-overlay.active .modal-content { animation: p3-pop .28s cubic-bezier(.2,.8,.2,1); }
.modal-content {
  max-width: 560px; padding: 0; border-radius: 18px; overflow: hidden auto; outline: none;
  background: var(--color-surface); border: 1px solid rgba(74,144,217,.35);
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.04);
  scrollbar-width: thin; scrollbar-color: var(--color-accent) transparent;
}
.modal-head {
  position: relative; padding: 30px 72px 22px 32px; border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, rgba(74,144,217,.22), rgba(74,144,217,.04) 70%), var(--color-surface-2);
  border-top: 4px solid var(--color-accent);
}
.modal-title { font-size: 1.7rem; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 8px; }
.modal-subtitle { font-size: .95rem; line-height: 1.55; color: var(--color-gray-300); margin: 0; }
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 42px; height: 42px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.modal-close:hover { background: var(--color-accent); transform: rotate(90deg); color: #fff; }
.modal-close:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 2px; }
.modal-form-wrapper { padding: 26px 32px 32px; min-height: 0; }
.modal-content .gd-form { gap: 22px; }
.modal-content .gd-field label { margin-bottom: 8px; font-size: .74rem; letter-spacing: .08em; }
.modal-content .gd-field input, .modal-content .gd-field textarea { padding: 14px 16px; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.modal-content .gd-field input:focus, .modal-content .gd-field textarea:focus { box-shadow: 0 0 0 3px var(--color-accent-glow); }
.modal-content .gd-consent { font-size: .8rem; line-height: 1.5; color: var(--color-gray-300); padding: 12px 14px; background: rgba(255,255,255,.04); border-radius: 8px; }
.modal-content .gd-submit {
  padding: 17px 24px; font-size: 1.02rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 10px 26px var(--color-accent-glow); margin-top: 0;
}
.modal-content .gd-submit:hover { transform: translateY(-1px); }
.modal-content .gd-success { padding: 36px 8px 12px; }
@keyframes p3-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes p3-pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes p3-sheet { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 768px) {
  .modal-overlay { padding: 0; align-items: flex-end; background: rgba(5,8,12,.88); }
  .modal-content {
    max-width: 100%; width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 20px 20px 0 0;
    border-bottom: 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-overlay.active .modal-content { animation: p3-sheet .3s cubic-bezier(.2,.8,.2,1); }
  .modal-head { padding: 24px 64px 18px 20px; }
  .modal-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 4px; background: rgba(255,255,255,.3); }
  .modal-title { font-size: 1.35rem; }
  .modal-form-wrapper { padding: 20px 20px 28px; }
  .modal-content .gd-field input, .modal-content .gd-field textarea { font-size: 16px; } /* evita zoom do iOS */
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay.active, .modal-overlay.active .modal-content, .nav-sub { animation: none !important; }
  .nav-caret svg, .modal-close { transition: none; }
}
/* Redes sociais no rodapé */
.footer-social { display: flex; gap: 12px; list-style: none; margin: 18px 0 0; padding: 0; }
.footer-social a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22); color: #fff; transition: background .25s, border-color .25s, color .25s; }
.footer-social a:hover { background: #d4af37; border-color: #d4af37; color: #111; }
