/* ==========================================================
   Rejex · Landing Page · custom styles
   Extraído do design-system.html (Statesmate base)
   ========================================================== */

/* Glass surfaces ------------------------------------------- */
.glass-panel {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-panel-dark {
  background: rgba(23, 23, 23, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Background grid ------------------------------------------ */
.grid-lines {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Hide scrollbar ------------------------------------------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Text gradient -------------------------------------------- */
.text-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(90deg, #171717, #525252);
}

/* Glass button (CTA primário) ------------------------------ */
@property --angle-1 { syntax: "<angle>"; inherits: false; initial-value: -75deg; }
@property --angle-2 { syntax: "<angle>"; inherits: false; initial-value: -45deg; }

.glass-button {
  background: linear-gradient(-75deg, rgba(189, 213, 100, 0.1), rgba(255, 255, 255, 0.5), rgba(189, 213, 100, 0.1));
  box-shadow:
    inset 0 0.125em 0.125em rgba(0, 0, 0, 0.05),
    inset 0 -0.125em 0.125em rgba(255, 255, 255, 0.5),
    0 0.25em 0.125em -0.125em rgba(0, 0, 0, 0.2),
    0 0 0.1em 0.25em rgba(189, 213, 100, 0.4) inset,
    0 0 0 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(4px);
  transition: all 400ms cubic-bezier(0.25, 1, 0.5, 1);
}
.glass-button:hover { transform: scale(0.98); }

.button-shine {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  width: calc(100% - 1px);
  height: calc(100% - 1px);
  top: 0.5px;
  left: 0.5px;
  background: linear-gradient(var(--angle-2), rgba(255, 255, 255, 0) 0%, rgba(189, 213, 100, 0.5) 40% 50%, rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: screen;
  pointer-events: none;
  background-size: 200% 200%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  transition: background-position 500ms, --angle-2 500ms;
}
.glass-button:hover .button-shine { background-position: 25% 50%; }

/* Reset all-unset (necessário pro glass-button funcionar em todos os browsers) */
.all-unset { all: unset; box-sizing: border-box; }

/* FAQ accordion -------------------------------------------- */
.faq-item[data-open="true"] .faq-icon { transform: rotate(45deg); }
.faq-item[data-open="true"] .faq-content {
  grid-template-rows: 1fr;
  padding-top: 0.75rem;
}
.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.25, 1, 0.5, 1), padding-top 300ms;
}
.faq-content > div { overflow: hidden; }

/* Mobile menu --------------------------------------------- */
[data-mobile-menu] {
  position: fixed;
  top: 4rem;          /* h-16 do header em mobile */
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 49;
}
[data-mobile-menu][data-open="false"] { display: none; }
[data-mobile-menu][data-open="true"]  { display: block; }
body[data-menu-open="true"] { overflow: hidden; }

/* Multi-step form (cadastro) ------------------------------- */
.signup-step[data-active="false"] { display: none; }

/* Smooth field focus ring ---------------------------------- */
.field-base {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid rgb(214 211 209); /* stone-300 */
  border-radius: 0.75rem;
  background: white;
  font-size: 0.95rem;
  color: rgb(28 25 23); /* stone-900 */
  transition: border-color 200ms, box-shadow 200ms;
  outline: none;
}
.field-base::placeholder { color: rgb(168 162 158); /* stone-400 */ }
.field-base:focus {
  border-color: #1d1e3c;
  box-shadow: 0 0 0 4px rgba(189, 213, 100, 0.35);
}
.field-base:disabled {
  background: rgb(245 245 244);
  color: rgb(120 113 108);
  cursor: not-allowed;
}
.field-base.is-invalid {
  border-color: rgb(220 38 38);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

/* Custom checkbox card (para os motivos no cadastro) ------- */
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgb(231 229 228); /* stone-200 */
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  transition: border-color 200ms, background 200ms;
}
.check-card:hover { border-color: rgb(168 162 158); /* stone-400 */ }
.check-card input[type="checkbox"] { display: none; }
.check-card .check-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgb(214 211 209);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 200ms;
}
.check-card .check-box svg { opacity: 0; transform: scale(0.7); transition: all 200ms; }
.check-card input[type="checkbox"]:checked ~ .check-box {
  background: #BDD564;
  border-color: #7cbf69;
}
.check-card input[type="checkbox"]:checked ~ .check-box svg { opacity: 1; transform: scale(1); }
.check-card:has(input[type="checkbox"]:checked) {
  border-color: #7cbf69;
  background: #f3f8e6;
}

/* Step indicator ------------------------------------------- */
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid rgb(214 211 209);
  background: white;
  color: rgb(120 113 108);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-dot[data-state="active"] {
  border-color: #1d1e3c;
  background: #1d1e3c;
  color: #BDD564;
}
.step-dot[data-state="done"] {
  border-color: #7cbf69;
  background: #BDD564;
  color: #1d1e3c;
}

/* Honeypot: escondido visualmente mas acessível para bots --- */
.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Cookie banner (LGPD) ------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 300ms ease-out, transform 300ms cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}
.cookie-banner[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cookie-banner-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(29, 30, 60, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}
@media (min-width: 768px) {
  .cookie-banner-inner {
    flex-direction: row;
    align-items: center;
    padding: 1.25rem 1.75rem;
    gap: 1.5rem;
  }
}
.cookie-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #BDD564;
  color: #1d1e3c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cookie-banner-text {
  flex: 1;
  min-width: 0;
}
.cookie-banner-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.cookie-banner-desc {
  font-size: 0.8125rem;
  color: rgb(212 212 216);
  line-height: 1.55;
  padding-right: 1.5rem;
}
.cookie-banner-link {
  color: #BDD564;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 0.25rem;
}
.cookie-banner-link:hover { color: white; }

.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.cookie-btn {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 200ms;
  white-space: nowrap;
  border: 1px solid transparent;
}
.cookie-btn-primary {
  background: #BDD564;
  color: #1d1e3c;
}
.cookie-btn-primary:hover {
  background: #a8c054;
  transform: scale(0.98);
}
.cookie-btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}
.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cookie-banner-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(168 162 158);
  background: transparent;
  cursor: pointer;
  transition: all 200ms;
}
.cookie-banner-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}
@media (min-width: 768px) {
  .cookie-banner-close { top: 0.5rem; right: 0.5rem; }
}

/* Printer animation (Nota fiscal section) ------------------ */
.printer-scene {
  position: relative;
  height: 360px;
  overflow: hidden;
  background: linear-gradient(180deg, #f5f5f4 0%, #e7e5e4 100%);
  border-radius: 1rem;
}
@media (min-width: 1024px) {
  .printer-scene { height: 420px; }
}

/* Paper exiting through the slot --------------------------- */
.printer-paper-wrap {
  position: absolute;
  left: 50%;
  bottom: 78px;             /* altura do corpo da impressora */
  transform: translateX(-50%);
  width: 168px;
  height: 320px;
  pointer-events: none;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .printer-paper-wrap { bottom: 92px; height: 380px; width: 180px; }
}

.printer-paper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fdfdfb;
  padding: 14px 12px 18px;
  border-radius: 4px 4px 1px 1px;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(0, 0, 0, 0.04) inset;
  animation: printPaper 7s cubic-bezier(0.6, 0.05, 0.3, 1) infinite;
  /* Curva sutil no topo simulando enrolamento natural do papel térmico */
  background-image:
    radial-gradient(ellipse at top, rgba(0, 0, 0, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #fdfdfb 0%, #fafaf9 100%);
}

@keyframes printPaper {
  0%, 4%   { transform: translateY(100%); }   /* escondido na impressora */
  45%, 78% { transform: translateY(0); }      /* totalmente fora */
  100%     { transform: translateY(100%); }   /* recolhe pra reiniciar */
}

/* Linhas de texto simuladas ------------------------------- */
.paper-line {
  height: 4px;
  background: #d6d3d1;
  border-radius: 2px;
  margin: 0 auto 5px;
}
.paper-line.heavy { background: #1d1e3c; height: 5px; }
.paper-divider {
  height: 1px;
  border-top: 1px dashed #d6d3d1;
  margin: 8px 4px;
}
.paper-qr {
  width: 56px;
  height: 56px;
  margin: 8px auto 6px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 1px;
  padding: 4px;
  background: white;
}
.paper-qr span { background: #1d1e3c; }
.paper-qr span.off { background: transparent; }

/* Corpo da impressora ------------------------------------- */
.printer-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(180deg, #2a2c4f 0%, #1d1e3c 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
@media (min-width: 1024px) {
  .printer-body { height: 105px; }
}
.printer-slot {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 5px;
  background: #0a0b1f;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) inset;
}
.printer-led {
  position: absolute;
  bottom: 18px;
  right: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #BDD564;
  box-shadow: 0 0 8px rgba(189, 213, 100, 0.6);
  animation: printerLed 2s ease-in-out infinite;
}
@keyframes printerLed {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.printer-label {
  position: absolute;
  bottom: 18px;
  left: 22px;
  font-family: 'Geist Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

/* Hero graph (ciclo financeiro) ---------------------------- */
.flow-graph {
  width: 100%;
  height: auto;
  max-width: 520px;
  margin: 0 auto;
  display: block;
}

/* Signal pulsando pelo ramo superior (Cliente → Venda → NFC-e → Pix → Caixa) */
.flow-signal-top {
  stroke-dasharray: 80 700;
  stroke-dashoffset: 80;
  animation: flowSignalTop 7s linear infinite;
}
@keyframes flowSignalTop {
  0%   { stroke-dashoffset: 80; opacity: 0; }
  4%   { opacity: 1; }
  46%  { stroke-dashoffset: -540; opacity: 1; }
  50%  { opacity: 0; }
  100% { stroke-dashoffset: -540; opacity: 0; }
}

/* Signal pulsando pelo ramo inferior (Cliente → Contrato → NFS-e → Pix → Caixa), defasado */
.flow-signal-bottom {
  stroke-dasharray: 80 700;
  stroke-dashoffset: 80;
  animation: flowSignalBottom 7s linear infinite;
  animation-delay: 3.5s;
}
@keyframes flowSignalBottom {
  0%   { stroke-dashoffset: 80; opacity: 0; }
  4%   { opacity: 1; }
  46%  { stroke-dashoffset: -540; opacity: 1; }
  50%  { opacity: 0; }
  100% { stroke-dashoffset: -540; opacity: 0; }
}

/* Pulse sequencial dos nós (sincronizado com signal-top, 7s loop) ----- */
.flow-node-cliente { animation: flowPulse 7s infinite ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes flowPulse {
  0%, 100% { transform: scale(1); }
  3% { transform: scale(1.35); }
  10% { transform: scale(1); }
}

.flow-node-vitrine { animation: flowNodeBox 7s infinite ease-out; transform-box: fill-box; transform-origin: center; }
.flow-node-venda   { animation: flowNodeBox 7s infinite ease-out 0.4s; transform-box: fill-box; transform-origin: center; }
.flow-node-nfce    { animation: flowNodeBox 7s infinite ease-out 0.8s; transform-box: fill-box; transform-origin: center; }
.flow-node-pix     { animation: flowNodeBox 7s infinite ease-out 1.4s; transform-box: fill-box; transform-origin: center; }
@keyframes flowNodeBox {
  0%, 100% { stroke-width: 1.5; transform: scale(1); stroke: #1d1e3c; }
  18% { stroke-width: 2.2; transform: scale(1.04); stroke: #7cbf69; }
  28% { stroke-width: 1.5; transform: scale(1); stroke: #1d1e3c; }
}

.flow-node-contrato { animation: flowNodeBoxBottom 7s infinite ease-out 3.5s; transform-box: fill-box; transform-origin: center; }
.flow-node-nfse     { animation: flowNodeBoxBottom 7s infinite ease-out 4s; transform-box: fill-box; transform-origin: center; }
@keyframes flowNodeBoxBottom {
  0%, 100% { stroke-width: 1.5; transform: scale(1); stroke: #1d1e3c; }
  18% { stroke-width: 2.2; transform: scale(1.04); stroke: #7cbf69; }
  28% { stroke-width: 1.5; transform: scale(1); stroke: #1d1e3c; }
}

.flow-node-caixa { animation: flowPulseFinal 7s infinite ease-out 2.5s; transform-box: fill-box; transform-origin: center; }
@keyframes flowPulseFinal {
  0%, 100% { transform: scale(1); fill: #1d1e3c; }
  6% { transform: scale(1.25); fill: #BDD564; }
  20% { transform: scale(1); fill: #1d1e3c; }
}

.flow-check {
  stroke-dasharray: 14;
  stroke-dashoffset: 14;
  animation: flowCheckDraw 7s linear infinite 2.5s;
}
@keyframes flowCheckDraw {
  0%, 4% { stroke-dashoffset: 14; opacity: 0; }
  10% { stroke-dashoffset: 0; opacity: 1; }
  90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

.flow-text { font-family: 'Geist', sans-serif; font-weight: 600; }

/* Reduce-motion respect ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
