/* Página de manutenção — identidade do shop: paper creme (#fffef9), ink verde
   (#1c3024), verdes NV e o MESMO card verde-escuro da newsletter da home
   (gradiente radial #59c47f sobre #1a3025). Portado 1:1 de
   nv-frontend-shop/src/components/shop/maintenance/maintenance.css, mais a base
   (reset, fonte, select, modal, toast) que lá vinha do Tailwind/shadcn. */

@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Variable.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #fffef9;
  color: #1c3024;
}

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

button,
input,
select {
  font: inherit;
}

.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;
}

/* ---------------------------------------------------------------------------
   Layout
--------------------------------------------------------------------------- */

.nv-maintenance {
  --paper: #fffef9;
  --ink: #1c3024;
  --ink-soft: #425046;
  --leaf: #0a7a41;
  --leaf-strong: #0d6b3a;
  --border: #e6ebdf;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

/* Brilho verde suave vindo do topo, como nas seções institucionais. */
.nv-maintenance::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 42% at 50% -8%, #59c47f2e, transparent 70%),
    radial-gradient(40% 30% at 92% 8%, #16a34a1f, transparent 70%);
  pointer-events: none;
}

.nv-maintenance__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 48px);
}

.nv-maintenance__logo {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: min(100%, 158px);
  flex-shrink: 1;
}
.nv-maintenance__logo img {
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left;
}
@media (min-width: 640px) {
  .nv-maintenance__logo { max-width: min(100%, 200px); }
  .nv-maintenance__logo img { height: 32px; }
}
@media (min-width: 768px) {
  .nv-maintenance__logo { max-width: min(100%, 240px); }
  .nv-maintenance__logo img { height: 36px; }
}

/* Seletor de idioma — mesmo look do SelectTrigger (shadcn, size="sm"). */
.nv-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 144px;
  max-width: 100%;
  flex-shrink: 0;
}
.nv-lang__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 32px;
  padding: 0 32px 0 12px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 #0000000d;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nv-lang__select:hover { background: #fafaf7; }
.nv-lang__select:focus-visible {
  outline: none;
  border-color: #0a7a41;
  box-shadow: 0 0 0 3px #0a7a4133;
}
.nv-lang__chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.5;
}

.nv-maintenance__main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(12px, 1.8vh, 20px);
  padding: 16px clamp(16px, 4vw, 48px) clamp(16px, 2.4vh, 28px);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.nv-maintenance__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #16a34a14;
  border: 1px solid #16a34a2e;
  color: var(--leaf-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nv-maintenance__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--leaf);
  box-shadow: 0 0 0 0 #16a34a66;
  animation: nv-maint-pulse 2.4s ease-out infinite;
}
@keyframes nv-maint-pulse {
  0% { box-shadow: 0 0 0 0 #16a34a55; }
  70% { box-shadow: 0 0 0 9px #16a34a00; }
  100% { box-shadow: 0 0 0 0 #16a34a00; }
}

.nv-maintenance__title {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(30px, 4.6vw, 48px);
  text-wrap: balance;
  color: var(--ink);
}

.nv-maintenance__body {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Card da newsletter — mesmo look do card da home (verde-escuro + glow). */
.nv-maintenance__news {
  margin-top: 4px;
  width: 100%;
  max-width: 560px;
  text-align: left;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #e6ebdf85;
  border-radius: 22px;
  padding: clamp(20px, 3.2vw, 30px);
  background:
    radial-gradient(ellipse at 93% 118%, #59c47f66, transparent 42%),
    linear-gradient(125deg, #ffffff1d, transparent 43%),
    #1a3025;
  color: #fff;
  box-shadow: inset 1px 1px 4px #ffffff40, 0 20px 40px -32px #0d1f16;
}
.nv-maintenance__news-title {
  margin: 0 0 6px;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nv-maintenance__news-sub {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #ffffffcc;
}
.nv-maintenance__news-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffffcc;
  margin-bottom: 8px;
}
.nv-maintenance__news-control {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.nv-maintenance__news input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 12px;
  background: #ffffff14;
  border: 1px solid #ffffff33;
  color: #fff;
  padding: 0 14px;
  font-size: 15px;
}
.nv-maintenance__news input[type="email"]::placeholder { color: #ffffff7a; }
.nv-maintenance__news input[type="email"]:focus-visible {
  outline: none;
  border-color: #7fe0a3;
  box-shadow: 0 0 0 3px #59c47f40;
}
.nv-maintenance__news input[type="email"]:disabled { opacity: 0.6; }

.nv-maintenance__news-btn {
  flex-shrink: 0;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #8fe3ab, #4fb97c);
  color: #0f2418;
  font-weight: 700;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.nv-maintenance__news-btn:hover:not(:disabled) { filter: brightness(1.05); }
.nv-maintenance__news-btn:disabled { opacity: 0.6; cursor: default; }
.nv-maintenance__news-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #59c47f66;
}

/* Estados do botão: idle (seta) → sending (spinner) → done (check). */
.nv-icon { display: none; flex-shrink: 0; }
.nv-maintenance__news-btn[data-state="idle"] .nv-icon--arrow { display: inline-block; }
.nv-maintenance__news-btn[data-state="sending"] .nv-icon--spinner { display: inline-block; }
.nv-maintenance__news-btn[data-state="done"] .nv-icon--check { display: inline-block; }
.nv-icon--spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #0f241833;
  border-top-color: #0f2418;
  animation: nv-spin 0.8s linear infinite;
}
@keyframes nv-spin { to { transform: rotate(360deg); } }

.nv-maintenance__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffffffb3;
  cursor: pointer;
}
.nv-maintenance__consent input { margin: 2px 0 0; accent-color: #4fb97c; }

/* Rodapé idêntico ao AuthPageFooter (telas de login): linha única centralizada
   com borda no topo e os links sublinhados. */
.nv-maintenance__foot {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: clamp(14px, 2vh, 22px) clamp(16px, 4vw, 48px);
}
.nv-maintenance__foot-line {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.nv-maintenance__foot-line button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s ease;
}
.nv-maintenance__foot-line button:hover { opacity: 0.8; }
.nv-maintenance__foot-line button:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------------------
   Modal de documento legal — mesmo look do LegalDocumentModal (shadcn Dialog):
   borda #d1d1d1, raio 14px, cabeçalho com título 30px #313e38, corpo com scroll.
--------------------------------------------------------------------------- */

.nv-dialog {
  width: min(48rem, calc(100% - 2rem));
  max-height: min(90dvh, 760px);
  margin: auto;
  padding: 0;
  border: 1px solid #d1d1d1;
  border-radius: 14px;
  background: #fff;
  color: #1c3024;
  box-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.nv-dialog[open] { display: flex; }
.nv-dialog::backdrop {
  background: #00000080;
}
.nv-dialog__head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
}
.nv-dialog__title {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: #313e38;
}
.nv-dialog__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #313e38;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.nv-dialog__close:hover { opacity: 1; background: #f3f4f1; }
.nv-dialog__close:focus-visible { outline: 2px solid #0a7a41; outline-offset: 1px; opacity: 1; }
.nv-dialog__scroll {
  height: min(70dvh, 620px);
  overflow-y: auto;
  padding: 12px 24px 20px 20px;
  overscroll-behavior: contain;
}
.nv-dialog__notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #16a34a14;
  border: 1px solid #16a34a2e;
  color: #0d6b3a;
  font-size: 13.5px;
  line-height: 1.5;
}
.nv-dialog__error {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #dc26264d;
  background: #dc26260d;
  color: #b91c1c;
  font-size: 14px;
}
.nv-dialog__muted {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

/* Tipografia do markdown — espelha DOCUMENT_MARKDOWN_CLASSNAMES do shop. */
.document-markdown {
  width: 100%;
  font-size: 16px;
  line-height: 1.625;
  color: #1c3024;
}
.document-markdown > *:first-child { margin-top: 0; }
.document-markdown h1 { margin: 32px 0 16px; font-size: 24px; font-weight: 700; line-height: 1.3; }
.document-markdown h2 { margin: 24px 0 12px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.document-markdown h3 { margin: 20px 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.document-markdown h4,
.document-markdown h5,
.document-markdown h6 { margin: 16px 0 8px; font-size: 16px; font-weight: 600; }
.document-markdown p { margin: 0 0 16px; color: #1c3024e6; }
.document-markdown ul { margin: 0 0 16px; padding-left: 24px; list-style: disc; }
.document-markdown ol { margin: 0 0 16px; padding-left: 24px; list-style: decimal; }
.document-markdown li { margin-bottom: 4px; }
.document-markdown a { color: #0a7a41; text-decoration: underline; text-underline-offset: 2px; }
.document-markdown strong { font-weight: 600; }
.document-markdown blockquote {
  margin: 0 0 16px;
  padding-left: 16px;
  border-left: 4px solid #e6ebdf;
  font-style: italic;
}
.document-markdown code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f3f4f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.document-markdown hr { margin: 24px 0; border: 0; border-top: 1px solid #e6ebdf; }
.document-markdown table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.document-markdown th,
.document-markdown td {
  border: 1px solid #e6ebdf;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.document-markdown th { background: #f3f4f166; font-weight: 600; }

/* ---------------------------------------------------------------------------
   Toast (sonner-like, canto inferior direito).
--------------------------------------------------------------------------- */

.nv-toaster {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.nv-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e6ebdf;
  background: #fff;
  color: #1c3024;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 25px -12px #0d1f1659;
  animation: nv-toast-in 0.22s ease-out;
}
.nv-toast--success { border-color: #16a34a4d; }
.nv-toast--error { border-color: #dc26264d; }
.nv-toast__icon { flex-shrink: 0; margin-top: 1px; }
.nv-toast--success .nv-toast__icon { color: #0a7a41; }
.nv-toast--error .nv-toast__icon { color: #b91c1c; }
.nv-toast--leaving { animation: nv-toast-out 0.2s ease-in forwards; }
@keyframes nv-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nv-toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .nv-maintenance__badge-dot,
  .nv-toast,
  .nv-toast--leaving { animation: none; }
}

/* ---------------------------------------------------------------------------
   Responsivo
--------------------------------------------------------------------------- */

/* Mobile: empilha o campo e o botão da newsletter (lado a lado fica apertado),
   e dá mais respiro vertical no conteúdo. */
@media (max-width: 560px) {
  .nv-maintenance__main {
    justify-content: flex-start;
    padding-top: clamp(32px, 10vw, 56px);
    gap: 18px;
  }
  .nv-maintenance__news-control {
    flex-direction: column;
    gap: 10px;
  }
  .nv-maintenance__news-btn {
    width: 100%;
    justify-content: center;
    height: 48px;
  }
  .nv-maintenance__news input[type="email"] {
    height: 48px;
  }
  .nv-dialog__title { font-size: 24px; }
  .nv-dialog__scroll { padding: 12px 16px 16px; }
}

/* Telas muito estreitas: reduz um tocar mais os títulos/paddings. */
@media (max-width: 380px) {
  .nv-maintenance__bar {
    padding-inline: 14px;
  }
  .nv-maintenance__title {
    font-size: clamp(28px, 8.4vw, 34px);
  }
  .nv-lang { width: 120px; }
}
