/* ND78 — components.css
 * Componentes de interface reconstruídos: menu mobile, modais de
 * autenticação/assinatura, aviso de cookies, toasts e utilitários.
 */

/* ------------------------------- Mobile menu ------------------------------- */
@media (max-width: 1080px) {
  .mobile-menu-list {
    display: block;
    position: fixed;
    inset: 72px 0 0 0;
    background: #fff;
    padding: 20px 24px 60px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 190;
  }
  body.nd-nav-open .mobile-menu-list { transform: translateX(0); }
  .mobile-menu { display: block; }
  .mobile-nav-ul, .now-mobile-list {
    list-style: none; margin: 0 0 8px; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  .mobile-nav-ul > li > a,
  .now-mobile-list > li > a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 6px; font-size: 16px; font-weight: 700; color: var(--nd-ink);
    border-bottom: 1px solid var(--nd-line);
  }
  .mobile-nav-ul .nd-acc-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
  .mobile-nav-ul .nd-acc-panel.open { max-height: 1200px; }
  .mobile-nav-ul .nd-acc-panel a { display: block; padding: 11px 16px; color: var(--nd-muted); font-size: 15px; }
  .mobile-nav-ul .nd-acc-title { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #a5a8b0; padding: 14px 16px 4px; }
  .nd-acc-caret { transition: transform 0.2s ease; }
  .mobile-nav-ul > li.open .nd-acc-caret { transform: rotate(180deg); }
}

/* --------------------------------- Modals --------------------------------- */
.nd-modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(17, 18, 24, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px;
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s;
}
.nd-modal-backdrop.open { opacity: 1; visibility: visible; }
.nd-modal {
  width: 100%; max-width: 440px; background: #fff; border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.3);
  padding: 34px; position: relative;
  /* margin:auto centraliza quando sobra espaço e recua ao topo quando o
     conteúdo é mais alto que a viewport (evita cortar o cabeçalho do modal). */
  margin: auto;
  transform: translateY(14px) scale(0.98); transition: transform 0.22s ease;
}
.nd-modal-backdrop.open .nd-modal { transform: translateY(0) scale(1); }
.nd-modal-close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border-radius: 50%; border: 0; background: var(--nd-bg-soft);
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--nd-muted);
}
.nd-modal-close:hover { background: var(--nd-line); color: var(--nd-ink); }
.nd-modal h3 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.nd-modal .nd-modal-sub { margin: 0 0 22px; color: var(--nd-muted); font-size: 14px; line-height: 1.6; }
.nd-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.nd-field label { font-size: 13px; font-weight: 600; color: var(--nd-ink-soft); }
.nd-field input {
  padding: 13px 14px; border: 1px solid var(--nd-line); border-radius: 12px;
  font-size: 15px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nd-field input:focus { border-color: var(--nd-orange); box-shadow: 0 0 0 3px rgba(255,120,45,0.15); }
.nd-modal .nd-submit {
  width: 100%; padding: 14px; border: 0; border-radius: 12px; margin-top: 6px;
  background: var(--nd-grad-orange); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 28px rgba(255,120,45,0.34);
}
.nd-modal .nd-submit:hover { transform: translateY(-1px); }
.nd-modal .nd-alt { margin-top: 18px; text-align: center; font-size: 13px; color: var(--nd-muted); }
.nd-modal .nd-alt a { color: var(--nd-orange); font-weight: 700; }
.nd-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.nd-social button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 1px solid var(--nd-line); border-radius: 12px;
  background: #fff; font-weight: 600; font-size: 14px; color: var(--nd-ink);
}
.nd-social button:hover { background: var(--nd-bg-soft); }
.nd-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: #b8bbc4; font-size: 12px; }
.nd-divider::before, .nd-divider::after { content: ""; flex: 1; height: 1px; background: var(--nd-line); }

.nd-plans { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.nd-plan {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--nd-line); border-radius: 14px; padding: 16px 18px; cursor: pointer;
}
.nd-plan.featured { border-color: var(--nd-orange); background: #fff7f2; }
.nd-plan .nd-plan-name { font-weight: 800; }
.nd-plan .nd-plan-price { color: var(--nd-orange); font-weight: 800; }
.nd-plan .nd-plan-desc { font-size: 13px; color: var(--nd-muted); }

/* --------------------------------- Cookies --------------------------------- */
.nd-cookies {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(920px, calc(100% - 32px)); z-index: 400;
  background: #fff; border: 1px solid var(--nd-line); border-radius: 18px;
  box-shadow: var(--nd-shadow); padding: 20px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s;
}
.nd-cookies.show { opacity: 1; visibility: visible; }
/* Em telas baixas o banner não pode cobrir conteúdo: fica compacto e rolável. */
@media (max-height: 660px) {
  .nd-cookies {
    bottom: 8px; padding: 12px 16px; gap: 10px;
    max-height: 46vh; overflow-y: auto;
  }
  .nd-cookies p { font-size: 13px; line-height: 1.5; }
  .nd-cookies button { padding: 9px 18px; font-size: 13px; }
}
.nd-cookies p { margin: 0; flex: 1; font-size: 14px; color: var(--nd-muted); line-height: 1.6; }
.nd-cookies a { color: var(--nd-orange); font-weight: 600; }
.nd-cookies .nd-cookie-actions { display: flex; gap: 10px; }
.nd-cookies button { padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1px solid var(--nd-line); background: #fff; color: var(--nd-ink); }
.nd-cookies button.primary { border: 0; background: var(--nd-grad-orange); color: #fff; }

/* --------------------------------- Toasts --------------------------------- */
.nd-toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 600; display: flex; flex-direction: column; gap: 10px; }
.nd-toast {
  min-width: 240px; max-width: 360px; padding: 14px 18px; border-radius: 14px;
  background: #17191d; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 18px 40px rgba(0,0,0,0.3);
  transform: translateY(12px); opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease;
}
.nd-toast.show { transform: translateY(0); opacity: 1; }
.nd-toast.success { background: linear-gradient(96deg, #1f9d63, #26b974); }
.nd-toast.info { background: linear-gradient(96deg, #3f92ff, #833ee4); }

/* --------------------------- Share tools / message -------------------------- */
#share-tools-root { position: relative; }
#share-tools-root.nd-tpl-host { display: contents; }
#messageRoot { position: relative; z-index: 420; }

/* ------------------------------ Focus / utils ------------------------------ */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--nd-orange); outline-offset: 2px; border-radius: 8px;
}
.nd-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nd-fade-up { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.nd-fade-up.nd-visible { opacity: 1; transform: translateY(0); }

/* Scroll-to-top */
.nd-top-btn {
  position: fixed; right: 20px; bottom: 88px; z-index: 150;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--nd-line);
  background: #fff; box-shadow: var(--nd-shadow-sm);
  display: none; align-items: center; justify-content: center; color: var(--nd-ink);
}
.nd-top-btn.show { display: inline-flex; }
