/* ─── Botão flutuante WhatsApp (site público) ─── */
.whatsapp-float {
  position: fixed;
  z-index: 180;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem 0.75rem 0.85rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 4px 14px rgba(37, 211, 102, 0.45),
    0 8px 28px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.whatsapp-float:hover {
  background: #20bd5a;
  color: #fff;
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 6px 20px rgba(37, 211, 102, 0.55),
    0 12px 32px rgba(0, 0, 0, 0.3);
}

.whatsapp-float:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.6);
  outline-offset: 3px;
}

.whatsapp-float__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
}

.whatsapp-float__text {
  line-height: 1;
}

@media (max-width: 480px) {
  .whatsapp-float {
    padding: 0.85rem;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    justify-content: center;
  }

  .whatsapp-float__text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

body.site-nav-open .whatsapp-float {
  z-index: 150;
}

/* ═══════════════════════════════════════════════════════════════
   Responsivo global — celular, tablet e desktop
   Carregado após samela.css / platform-dashboard.css / landing-english.css
   ═══════════════════════════════════════════════════════════════ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
}

img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* Tabelas e blocos largos não estouram a largura */
table {
  max-width: 100%;
}

.table-scroll,
.rs-table-wrap,
.platform-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Áreas seguras (iPhone com notch) */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  .site-header,
  .dash-topbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .site-footer {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

/* ─── Header público (landing + páginas layout.php) ─── */
.site-header__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.page-landing-english .site-header__menu-btn {
  border-color: var(--en-border, rgba(30, 58, 95, 0.15));
  background: #fff;
  color: var(--en-text, #1e3a5f);
}

.site-header__menu-btn svg {
  width: 22px;
  height: 22px;
}

.site-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.site-nav-backdrop[hidden] {
  display: none !important;
}

body.site-nav-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: nowrap;
    gap: 0.75rem;
    padding: 0.75rem max(1rem, 4vw);
  }

  .site-header__menu-btn {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .site-header .logo,
  .site-header .site-brand {
    order: 1;
    font-size: 1.1rem;
    max-width: calc(100% - 3.5rem);
  }

  .site-header .site-brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-header .site-logo-img {
    max-height: 36px;
    width: auto;
  }

  .site-header nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: min(100%, 320px);
    max-width: 100vw;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4.5rem 1.25rem 1.5rem;
    margin: 0;
    background: var(--bg-elevated, #0c0c12);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-landing-english .site-header nav {
    background: #fff;
    border-left-color: var(--en-border, rgba(30, 58, 95, 0.1));
    box-shadow: -8px 0 32px rgba(30, 58, 95, 0.12);
  }

  body.site-nav-open .site-header nav {
    transform: translateX(0);
  }

  .site-header nav > a:not(.btn-en):not(.btn-primary):not(.btn-ghost) {
    display: block !important;
    padding: 0.85rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 1;
  }

  .page-landing-english .site-header nav > a:not(.btn-en):not(.btn-primary):not(.btn-ghost) {
    display: block !important;
    border-bottom-color: var(--en-border, rgba(30, 58, 95, 0.08));
    color: var(--en-text, #1e3a5f);
  }

  .site-header nav .btn-en,
  .site-header nav .btn-primary,
  .site-header nav .btn-ghost {
    display: flex !important;
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
    min-height: 2.75rem;
  }

  .site-footer {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.88rem;
  }

  .site-footer p {
    margin: 0;
    line-height: 1.5;
  }

  main {
    padding-top: 0;
  }

  .hero {
    min-height: auto;
    padding: 6rem 1rem 3rem;
  }

  .form-card {
    max-width: none;
    margin: 5rem 1rem 2rem;
    padding: 1.5rem 1.25rem;
  }

  .course-header {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .player-wrap {
    margin: 1rem;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .auth-register-stepper__label {
    font-size: 0.58rem;
  }

  .auth-register-stepper__num {
    width: 1.45rem;
    height: 1.45rem;
    font-size: 0.72rem;
  }

  .auth-register-actions {
    flex-direction: column;
  }

  .auth-register-actions .auth-btn,
  .auth-register-actions__spacer {
    width: 100%;
    min-width: 0;
  }

  .auth-register-actions__spacer {
    display: none;
  }

  .auth-form__row {
    grid-template-columns: 1fr;
  }
}

/* ─── Plataforma (reforço) ─── */
@media (max-width: 900px) {
  .page-platform-dash .dash-topbar {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
  }

  .page-platform-dash .dash-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .page-platform-dash .dash-search-kbd {
    display: none;
  }

  .page-platform-dash .dash-topbar-page-title h1 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .page-platform-dash .platform-content {
    padding: 1rem;
  }

  .page-platform-dash .dash-streak {
    display: none;
  }
}

@media (max-width: 480px) {
  .page-platform-dash .dash-topbar-actions .dash-notif-btn {
    display: none;
  }

  .page-platform-dash .dash-topbar-logo-text {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Toques confortáveis em controles principais */
@media (hover: none) and (pointer: coarse) {
  .btn-primary,
  .btn-ghost,
  .btn-en,
  .auth-btn,
  .rs-btn,
  .sidebar-link,
  .lesson-item-btn,
  .rs-lesson-item {
    min-height: 2.75rem;
  }
}
