/* ============================================================
   HDB — seletor de idiomas + responsividade (mobile/tablet)
   Carregado depois do <style> inline da landing.
   ============================================================ */

/* ---------------------------- Seletor de idioma --------------------------- */
.hdb-lang {
  position: relative;
  flex: 0 0 auto;
}

.hdb-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong, #24503a);
  background: var(--bg-secondary, #0a1a12);
  color: var(--text-primary, #e6f3ea);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.hdb-lang-btn:hover,
.hdb-lang-btn:focus-visible {
  border-color: var(--accent, #3fb950);
  background: var(--card-hover, rgba(16, 38, 26, .9));
  outline: none;
}

.hdb-lang .hdb-flag {
  display: block;
  width: 22px;
  height: 15px;
  border-radius: 2px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}

.hdb-lang .hdb-flag svg {
  display: block;
  width: 22px;
  height: 15px;
}

.hdb-lang .hdb-code {
  letter-spacing: .06em;
}

.hdb-lang .chev {
  width: 11px;
  height: 11px;
  opacity: .7;
  transition: transform .18s ease;
}

.hdb-lang.open .chev { transform: rotate(180deg); }

.hdb-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  display: none;
  border-radius: 12px;
  border: 1px solid var(--border-strong, #24503a);
  background: rgba(6, 18, 12, .98);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .62);
  z-index: 80;
}

.hdb-lang.open .hdb-lang-menu { display: block; }

.hdb-lang-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #e6f3ea);
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.hdb-lang-menu button:hover { background: rgba(63, 185, 80, .12); }

.hdb-lang-menu button[aria-checked="true"] {
  background: rgba(63, 185, 80, .16);
  font-weight: 800;
}

.hdb-lang-menu .tick {
  margin-left: auto;
  color: var(--accent, #3fb950);
  opacity: 0;
  font-size: .9rem;
}

.hdb-lang-menu button[aria-checked="true"] .tick { opacity: 1; }

/* ------------------------- Robustez de layout geral ----------------------- */
h1, h2, h3, h4, p, li, span, a, button { overflow-wrap: break-word; }

.grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)) !important; }
.plans { grid-template-columns: repeat(auto-fit, minmax(min(238px, 100%), 1fr)) !important; }

.plan .price { white-space: normal; }

/* ---------------------------------- Tablet -------------------------------- */
@media (max-width: 1024px) {
  .wrap { padding: 0 22px; }
  .hero { padding: 64px 0 46px; }
}

@media (max-width: 860px) {
  header.topbar { padding: 12px 18px; gap: 12px; }
  .brand { gap: 11px; }
  .brand .logo { width: 46px; height: 46px; }
  .brand-titles h1 { font-size: 1rem; letter-spacing: .08em; }
  .brand-titles .sub { font-size: .62rem; letter-spacing: .18em; }
  .hero { padding: 58px 0 42px; }
  .hero h2 { font-size: clamp(1.7rem, 5.2vw, 2.4rem); }
  section.block { padding: 44px 0; }
}

/* ------------------------------- Mobile grande ---------------------------- */
@media (max-width: 640px) {
  header.topbar { padding: 12px 16px; gap: 10px; }
  .brand .logo { width: 42px; height: 42px; }
  .brand-titles h1 { font-size: .95rem; letter-spacing: .06em; }
  .brand-titles .sub { font-size: .58rem; letter-spacing: .16em; }
  .header-actions .btn { padding: 8px 12px; font-size: .78rem; }
  .wrap { padding: 0 16px; }
  .hero { padding: 46px 0 36px; }
  .hero p { font-size: .95rem; }
  .hero-cta .btn { padding: 12px 18px; font-size: .9rem; }
  section.block { padding: 38px 0; }
  .card { padding: 18px 16px; }
  .plan { padding: 20px 16px; }
  .hdb-modal { padding: 22px 18px 18px; }
  .hdb-modal input, .hdb-modal input[type="text"], .hdb-modal input[type="password"] { font-size: 16px; }

  footer { padding: 18px 16px; }
  .foot-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
  }
  .foot-inner .dotsep { display: none; }
}

/* ---------------------------- Mobile: header 2 linhas --------------------- */
@media (max-width: 560px) {
  header.topbar { flex-wrap: wrap; row-gap: 10px; }
  .brand { flex: 1 1 100%; min-width: 0; }
  .spacer { display: none; }
  .header-actions { flex: 1 1 100%; justify-content: flex-end; }
  .brand-titles h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: .92rem;
    letter-spacing: .05em;
    line-height: 1.25;
  }
  .brand-titles .sub {
    white-space: normal;
    letter-spacing: .14em;
    line-height: 1.4;
  }
}

/* --------------------------------- Mobile pequeno ------------------------- */
@media (max-width: 400px) {
  header.topbar { padding: 10px 14px; row-gap: 8px; }
  .brand .logo { width: 36px; height: 36px; border-radius: 9px; }
  .brand-titles h1 { font-size: .84rem; letter-spacing: .03em; }
  .brand-titles .sub { font-size: .53rem; letter-spacing: .1em; }
  .header-actions { gap: 7px; }
  .header-actions .btn { padding: 8px 10px; font-size: .74rem; gap: 6px; }
  .header-actions .btn svg { width: 14px; height: 14px; }
  .hdb-lang-btn { padding: 7px 8px; font-size: .74rem; gap: 6px; }
  .hdb-lang-menu { min-width: 168px; }
  .wrap { padding: 0 14px; }
  .hero { padding: 38px 0 30px; }
  .hero h2 { font-size: 1.55rem; }
  .hero p { font-size: .9rem; }
  .kicker { font-size: .62rem; letter-spacing: .2em; padding: 6px 12px; }
  .chip { font-size: .69rem; padding: 5px 11px; }
  .sec-head h3 { font-size: 1.35rem; }
  .plan .price { font-size: 1.55rem; }
  .cta-band { padding: 30px 18px; }
  .hdb-modal { padding: 20px 16px 16px; }
}

@media (max-width: 340px) {
  .header-actions .btn { padding: 7px 8px; font-size: .7rem; }
  .hdb-lang-btn .hdb-code { display: none; }
  .brand-titles h1 { font-size: .78rem; }
}

/* ---------------------------------- Impressão ----------------------------- */
@media print {
  header.topbar, .hdb-lang, .hero-cta, .cta-band, .hdb-overlay { display: none !important; }
}
