/* ============================================================
   CloudReg — website institucional
   Branding contratual: pitch deck do cliente (ver docs/BRANDING.md)
   Tipografia: Montserrat (display) + Open Sans (texto)
   Temas: dark (assinatura do site) + light (paleta do deck)
   ============================================================ */

:root {
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-card: 22px;

  /* accents de marca (iguais nos dois temas) */
  --primary: #658afa;
  --primary-rgb: 101, 138, 250;
  --accent-2: #24d9cc;
  --accent-3: #f9ad34;
}

[data-theme="dark"] {
  --bg: #060a16; /* navy quase preto */
  --bg-2: #0a1124;
  --ink: #eef2fb;
  --muted: #8a97b8;
  --line: rgba(140, 160, 210, 0.14);
  --cyan: #4cc9f0;
  --cyan-soft: #7ee0ff;

  --nav-bg: rgba(6, 10, 22, 0.72);
  --hero-glow: #101a36;
  --card-bg: linear-gradient(180deg, rgba(101, 138, 250, 0.06), transparent);
  --card-shadow: none;
  --card-border-hover: rgba(101, 138, 250, 0.45);
  --btn-ink: #ffffff;
  --selection-bg: var(--primary);
  --selection-ink: #ffffff;
}

[data-theme="light"] {
  --bg: #f2f3f6; /* fundo dos slides do deck */
  --bg-2: #dbe9fe; /* painéis do deck */
  --ink: #0b1533;
  --muted: #5a6478;
  --line: rgba(11, 21, 51, 0.1);
  --cyan: #2e6be6; /* nos detalhes, o azul do gradiente do logo */
  --cyan-soft: #658afa;

  --nav-bg: rgba(242, 243, 246, 0.8);
  --hero-glow: #ffffff;
  --card-bg: #ffffff;
  --card-shadow: 0 14px 34px -14px rgba(11, 21, 51, 0.14);
  --card-border-hover: rgba(101, 138, 250, 0.55);
  --btn-ink: #ffffff;
  --selection-bg: var(--primary);
  --selection-ink: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Open Sans", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition:
    background 0.4s var(--ease),
    color 0.4s var(--ease);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-ink);
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  transition:
    background 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease),
    padding 0.4s var(--ease);
}
.nav.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: 14px;
  padding-bottom: 14px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.nav__brand img {
  height: 26px;
  width: auto;
  display: block;
}
.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
}
.nav__menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.25s var(--ease);
}
.nav__menu a:hover {
  color: var(--ink);
}
/* selector com a especificidade de `.nav__menu a:hover` (e declarado depois) para
   manter a cor do CTA sem recorrer a !important */
.nav__menu a.nav__cta {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 18px;
  color: var(--ink);
}
.nav__cta:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

/* alternador de tema */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--primary);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
  display: block;
}
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}
[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}
[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* alternador de idioma — mostra a língua-alvo (PT/EN) */
.lang-toggle {
  height: 36px;
  min-width: 36px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.lang-toggle:hover {
  color: var(--ink);
  border-color: var(--primary);
}

@media (max-width: 720px) {
  .nav__menu a:not(.nav__cta) {
    display: none;
  }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 8%, var(--hero-glow) 0%, var(--bg) 60%), var(--bg);
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero__overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: clamp(34px, 7vh, 72px);
  pointer-events: none;
}
.hero__eyebrow {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan-soft);
  opacity: 0.85;
  margin-bottom: 18px;
}
.hero__tagline {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: clamp(17px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--ink);
  opacity: 0.92;
  max-width: 620px;
}
.hero__scroll {
  margin-top: 30px;
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  position: relative;
  pointer-events: auto;
}
.hero__scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  background: var(--primary);
  border-radius: 4px;
  animation: scrolldot 1.8s var(--ease) infinite;
}
@keyframes scrolldot {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  70% {
    transform: translateY(14px);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ============ SECTIONS ============ */
.section {
  padding: clamp(80px, 13vh, 160px) clamp(20px, 5vw, 56px);
  border-top: 1px solid var(--line);
  transition: background 0.4s var(--ease);
}
.section--dark {
  background: var(--bg-2);
}
.section--contact {
  text-align: center;
}
.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section__inner--center {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.section__kicker {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 22px;
}
.section__title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: clamp(27px, 4.4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 26px;
}
.section--contact .section__title {
  max-width: none;
}
.section__lead {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--muted);
  max-width: 60ch;
}
.section__lead--center {
  margin: 0 auto 8px;
}
.section__source {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  opacity: 0.7;
}

/* mockups do produto (frames arredondados como no deck) */
.shot {
  margin-top: 52px;
}
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}

/* números do mercado (big numbers em cartões coloridos, como no deck) */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 48px;
}
.stat {
  border-radius: var(--radius-card);
  padding: 32px 28px;
}
.stat strong {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 14px;
}
.stat p {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}
.stat small {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 400;
  opacity: 0.8;
}
.stat--blue {
  background: var(--primary);
  color: #ffffff;
}
.stat--teal {
  background: var(--accent-2);
  color: #0b1533;
}
.stat--amber {
  background: var(--accent-3);
  color: #0b1533;
}

/* cartões do modelo com título na cor do trio do deck */
.card--blue h3 {
  color: var(--primary);
}
.card--teal h3 {
  color: var(--accent-2);
}
.card--amber h3 {
  color: var(--accent-3);
}

/* cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 48px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 26px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition:
    transform 0.4s var(--ease),
    border-color 0.4s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
}
.card h3 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 19px;
  margin-bottom: 10px;
}
.card p {
  color: var(--muted);
  font-size: 15px;
}

/* steps */
.steps {
  margin-top: 44px;
  counter-reset: step;
  max-width: 760px;
}
.steps li {
  list-style: none;
  position: relative;
  padding: 22px 0 22px 64px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
}
.steps li:last-child {
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 22px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: var(--primary);
  font-size: 17px;
}
.steps li span {
  color: var(--ink);
  font-weight: 600;
}

/* contacto */
.btn {
  display: inline-block;
  margin: 14px 0 22px;
  padding: 15px 32px;
  border-radius: 100px;
  background: var(--primary);
  color: var(--btn-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
  box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.5);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -8px rgba(var(--primary-rgb), 0.55);
}
.section__fineprint {
  color: var(--muted);
  font-size: 13px;
  opacity: 0.6;
}

/* ============ Publicitação PRR (obrigatória — barra + cartaz) ============ */
.prr__links {
  margin-top: 18px;
  font-size: 14.5px;
}
.prr__links a {
  color: var(--primary);
  text-decoration: none;
}
.prr__links a:hover {
  text-decoration: underline;
}
/* a barra é um <button> (abre o cartaz em modal) — reset de aparência nativa */
.prr__bar-link {
  display: inline-block;
  margin-top: 28px;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-card);
  transition: opacity 0.2s var(--ease);
}
.prr__bar-link:hover {
  opacity: 0.85;
}
.prr__bar-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}
.prr-bar {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
  pointer-events: none;
}
/* duas versões da barra: branca no tema dark, a cores no light */
[data-theme="dark"] .prr-bar--light {
  display: none;
}
[data-theme="light"] .prr-bar--dark {
  display: none;
}

/* ============ Modal de pré-visualização de PDF (cartaz PRR) ============ */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 40px);
}
.pdf-modal[hidden] {
  display: none;
}
.pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  cursor: zoom-out;
  background: rgba(6, 10, 22, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
[data-theme="light"] .pdf-modal__backdrop {
  background: rgba(11, 21, 51, 0.5);
}
.pdf-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  height: min(88vh, 960px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.pdf-modal__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 10px 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.pdf-modal__title {
  flex: 1;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-modal__open {
  font-size: 13.5px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.pdf-modal__open:hover {
  text-decoration: underline;
}
.pdf-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pdf-modal__close:hover {
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--ink);
}
.pdf-modal__frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* footer */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 30px clamp(20px, 5vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer__prr {
  flex-basis: 100%;
  margin-bottom: 14px;
}
.footer__prr .prr-bar {
  max-width: 440px;
}
/* logo + wordmark, igual ao header (nav__brand) mas à escala do rodapé */
.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.footer__brand img {
  height: 18px;
  width: auto;
  display: block;
}
/* 3 colunas iguais => o "Developed by dappio" fica no centro exacto do ecrã */
.footer > a,
.footer > span {
  flex: 1 1 0;
  min-width: max-content;
}
.footer > *:last-child {
  text-align: right;
}
.footer__dev {
  text-align: center;
}
.footer__dev a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.footer__dev a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero__scroll span {
    animation: none;
  }
  body,
  .section {
    transition: none;
  }
}

/* ============ PAINEL DE CONTROLO (dev — mantém-se escuro nos 2 temas) ============ */
.cr-panel {
  position: fixed;
  top: 84px;
  right: clamp(12px, 3vw, 28px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.cr-panel__toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(140, 160, 210, 0.14);
  background: rgba(10, 17, 36, 0.72);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}
.cr-panel__toggle:hover {
  border-color: #4cc9f0;
}
.cr-panel__toggle span {
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #7ee0ff;
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease);
}
.cr-panel.is-open .cr-panel__toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.cr-panel.is-open .cr-panel__toggle span:nth-child(2) {
  opacity: 0;
}
.cr-panel.is-open .cr-panel__toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.cr-panel__body {
  width: 268px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(10, 17, 36, 0.82);
  backdrop-filter: blur(16px);
  color: #eef2fb;
  transition:
    max-height 0.4s var(--ease),
    opacity 0.3s var(--ease),
    padding 0.4s var(--ease),
    border-color 0.3s var(--ease);
}
.cr-panel.is-open .cr-panel__body {
  max-height: 78vh;
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
  padding: 18px;
  border-color: rgba(140, 160, 210, 0.14);
}
.cr-panel__title {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #eef2fb;
  margin-bottom: 14px;
}
.cr-fps {
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 11px;
  float: right;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(140, 160, 210, 0.12);
  letter-spacing: 0;
}
.cr-fps.is-good {
  color: #5bd9a0;
}
.cr-fps.is-ok {
  color: #7ee0ff;
}
.cr-fps.is-bad {
  color: #ff8a6b;
}

.cr-field {
  margin-bottom: 13px;
}
.cr-field label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8a97b8;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.cr-field label b {
  color: #7ee0ff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cr-field--count {
  padding-top: 6px;
  border-top: 1px solid rgba(140, 160, 210, 0.14);
  margin-top: 4px;
}

.cr-panel input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(140, 160, 210, 0.22);
  outline: none;
}
.cr-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #4cc9f0;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.18);
  transition: box-shadow 0.2s var(--ease);
}
.cr-panel input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(76, 201, 240, 0.28);
}
.cr-panel input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  background: #4cc9f0;
  cursor: pointer;
}

.cr-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #eef2fb;
  margin: 14px 0;
  cursor: pointer;
}
.cr-check input {
  accent-color: #4cc9f0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.cr-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.cr-buttons button {
  flex: 1;
  padding: 9px 0;
  border-radius: 9px;
  border: 1px solid rgba(140, 160, 210, 0.14);
  background: rgba(91, 140, 255, 0.1);
  color: #eef2fb;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.cr-buttons button:hover {
  border-color: #4cc9f0;
  background: rgba(76, 201, 240, 0.16);
}
.cr-reset {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8a97b8;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.cr-reset:hover {
  color: #7ee0ff;
}

@media (max-width: 760px) {
  .cr-panel {
    top: 72px;
  }
  .cr-panel__body {
    width: min(76vw, 268px);
  }
}
