/* =========================================================
   Promipharm: portal de produtos
   Tema azul sobre base clara: fundo gelo quase branco, azul
   forte (área médica), azul suave (área de consumo) e rodapé
   marinho. Fundo com partículas interativas e brilhos leves.
   Tipografia: Century Gothic, com Poppins como alternativa.
   ========================================================= */

:root {
  --bg: #F4F8FC;
  --card: #FFFFFF;
  --ink: #0A2547;
  --muted: #52719E;
  --navy-deepest: #05122A;
  --navy-deep: #071831;
  --azure-strong: #1565BE;
  --azure: #1E7BD7;
  --azure-soft: #4FA3EE;
  --sky: #8FC1F2;
  --mist: #B9D4F0;
  --ice: #EDF5FD;
  --panel-light-1: #E2EFFB;
  --panel-light-2: #C9E0F7;
  --line: rgba(21, 101, 190, 0.18);
  --radius: 18px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Century Gothic", CenturyGothic, "Poppins", system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 2px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--azure-strong);
}

/* ======= Fundo (partículas + brilhos leves) ======= */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-base {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #FBFDFF 0%, var(--bg) 50%, #E9F1F9 100%);
}

.bg-layer {
  position: absolute;
  inset: 0 0 auto;
  height: 400vh;
  will-change: transform;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  animation: drift 36s ease-in-out infinite alternate;
}

.bg-glow--1 {
  top: 2%;
  left: -14%;
  width: 58vw;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(30, 123, 215, 0.1) 0%, transparent 68%);
}

.bg-glow--2 {
  top: 14%;
  right: -16%;
  width: 48vw;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(79, 163, 238, 0.09) 0%, transparent 68%);
  animation-delay: -12s;
}

.bg-glow--3 {
  top: 32%;
  left: 18%;
  width: 44vw;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(21, 101, 190, 0.07) 0%, transparent 70%);
  animation-delay: -24s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vw, 3vh) scale(1.12); }
}

#particles-js {
  position: absolute;
  inset: 0;
}

#particles-js canvas { display: block; }

/* ======= Cabeçalho ======= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wordmark img {
  display: block;
  height: 56px;
  width: auto;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.2rem);
  font-size: 0.92rem;
}

.topnav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.topnav a:hover { color: var(--azure-strong); }

.topnav-phone {
  font-weight: 500;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  background: var(--card);
}

/* ======= Introdução ======= */

.intro {
  text-align: center;
  padding: clamp(2.5rem, 7vh, 5rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
}

/* Escondido visualmente, mas presente para leitores de ecrã */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Lema da Promipharm, com autor */
.lema {
  max-width: 56rem;
  margin: 0 auto;
}

.lema p {
  font-weight: 300;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.lema-destaque,
.lema p.lema-destaque {
  margin-top: 1.1rem;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  color: var(--azure-strong);
}

.lema-autor {
  margin-top: 1.4rem;
}

.lema-autor strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.lema-autor span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro-lead {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ======= Portal: as duas áreas ======= */

.portal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.9rem, 2vw, 1.4rem);
  padding: 0 var(--gutter) clamp(3rem, 7vh, 5rem);
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 3vh, 2.4rem);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 3.5vw, 3rem);
  min-height: min(66vh, 620px);
  cursor: pointer;
  box-shadow: 0 20px 50px -30px rgba(13, 60, 120, 0.35);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px -28px rgba(13, 60, 120, 0.5);
}

.panel--medico {
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(79, 163, 238, 0.4) 0%, transparent 55%),
    linear-gradient(165deg, var(--azure-strong) 0%, #0C3268 60%, #0A2452 100%);
  color: var(--ice);
}

.panel--medico .panel-kicker { color: var(--sky); }
.panel--medico .panel-desc { color: var(--mist); }

.panel--nao-medico {
  background: linear-gradient(165deg, var(--panel-light-1) 0%, var(--panel-light-2) 100%);
  border: 1px solid rgba(21, 101, 190, 0.12);
  color: var(--ink);
}

.panel--nao-medico .panel-kicker { color: var(--azure-strong); }
.panel--nao-medico .panel-desc { color: #33517A; }

.panel-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.panel h2 {
  font-weight: 400;
  font-size: clamp(1.6rem, 2.9vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.7rem;
}

.panel-desc {
  margin-top: 0.9rem;
  max-width: 34ch;
  font-size: 0.98rem;
}

.brand-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.brand-grid li {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid currentColor;
  opacity: 0.85;
}

/* Chips com logótipo: pastilha sem contorno; no painel escuro é um vidro
   translúcido, no painel claro é marinho (os logos brancos exigem fundo escuro) */
.brand-grid li.logo-chip {
  border: none;
  opacity: 1;
  padding: 0.9rem 1.4rem;
}

.panel--medico .logo-chip {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.panel--nao-medico .logo-chip {
  background: linear-gradient(160deg, #0C3268 0%, #0A2452 100%);
  box-shadow: 0 10px 24px -14px rgba(10, 36, 82, 0.7);
}

.brand-grid img {
  display: block;
  height: 30px;
  width: auto;
}

.logo-chip--alto img { height: 56px; }
.logo-chip--largo img { height: 23px; }

.panel-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  align-self: flex-start;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  transition: gap 0.25s ease, background-color 0.25s ease;
}

.panel-cta:hover { gap: 1rem; }

.panel-cta svg { width: 18px; height: 18px; }

.panel--medico .panel-cta {
  background: var(--ice);
  color: #0A2C5C;
}

.panel--medico .panel-cta:hover { background: #FFFFFF; }

.panel--nao-medico .panel-cta {
  background: var(--azure);
  color: #FFFFFF;
}

.panel--nao-medico .panel-cta:hover { background: var(--azure-strong); }

/* ======= Contacte-nos ======= */

.contact {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) 7fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter);
  border-top: 1px solid rgba(21, 101, 190, 0.12);
}

.contact h2 {
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-top: 0.8rem;
}

.contact-lead {
  margin-top: 0.8rem;
  color: var(--muted);
}

.contact-list {
  list-style: none;
  margin-top: 2rem;
  display: grid;
  gap: 1.1rem;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.contact-list svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--azure);
}

.contact-list a {
  text-decoration: none;
}

.contact-list a:hover { color: var(--azure-strong); }

/* --- Formulário --- */

.contact-form {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  display: grid;
  gap: 1.1rem;
  box-shadow: 0 20px 50px -34px rgba(13, 60, 120, 0.4);
}

.honey {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.field { display: grid; gap: 0.35rem; }

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 3px rgba(30, 123, 215, 0.14);
}

.field textarea { resize: vertical; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.consent input {
  margin-top: 0.3rem;
  accent-color: var(--azure);
}

.submit {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #FFFFFF;
  background: var(--azure);
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2.1rem;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.submit:hover { background: var(--azure-strong); }

.submit.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

/* --- Confirmação de envio --- */

.form-sent {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  color: var(--azure);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s 0.45s;
}

.contact-form.is-sent .form-sent {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease;
}

.form-sent-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
}

.form-sent-mark circle {
  stroke-dasharray: 183;
  stroke-dashoffset: 183;
}

.form-sent-mark path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}

.is-sent .form-sent-mark circle { animation: draw 0.7s ease forwards 0.2s; }
.is-sent .form-sent-mark path { animation: draw 0.45s ease forwards 0.8s; }

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.form-sent-title {
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  opacity: 0;
}

.form-sent-sub {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: var(--muted);
  opacity: 0;
}

.is-sent .form-sent-title { animation: fade-up 0.5s ease forwards 1s; }
.is-sent .form-sent-sub { animation: fade-up 0.5s ease forwards 1.15s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======= Rodapé ======= */

.footer {
  background: var(--navy-deepest);
  color: var(--mist);
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) 1.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  font-size: 0.95rem;
}

.footer-logo {
  display: block;
  height: 52px;
  width: auto;
  /* O ficheiro é preto; no rodapé escuro passa a branco. */
  filter: brightness(0) invert(1);
}

.footer-tag {
  margin-top: 0.6rem;
  max-width: 32ch;
}

.footer-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: 0.6rem;
}

.footer a {
  text-decoration: none;
}

.footer a:hover { color: var(--ice); }

.footer-legal {
  max-width: 1280px;
  margin: 2.5rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(143, 193, 242, 0.18);
  font-size: 0.85rem;
}

/* ======= Diálogo: produtos não médicos ======= */

.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  width: min(92vw, 520px);
  margin: auto;
}

.dialog::backdrop {
  background: rgba(7, 24, 49, 0.5);
  backdrop-filter: blur(3px);
}

.dialog h3 {
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-top: 0.7rem;
}

.dialog-lead {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.dialog-close:hover { color: var(--azure-strong); border-color: var(--azure); }

.dialog-close svg { width: 16px; height: 16px; }

.dialog-choices {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.choice:hover {
  border-color: var(--azure);
  background: var(--bg);
}

.choice-brand {
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* Logótipo da marca dentro da opção: pastilha marinho, já que os logos são brancos */
.choice-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0C3268 0%, #0A2452 100%);
  border-radius: 11px;
  padding: 0.7rem 1.1rem;
  min-width: 128px;
}

.choice-logo img {
  display: block;
  height: 22px;
  width: auto;
}

.choice-logo--alto img { height: 44px; }

.choice-url {
  margin-left: auto;
  font-size: 0.88rem;
  color: var(--muted);
}

.choice svg {
  width: 18px;
  height: 18px;
  color: var(--azure);
  flex-shrink: 0;
}

/* ======= WhatsApp ======= */

.wa {
  position: fixed;
  right: clamp(1rem, 3vw, 1.8rem);
  bottom: clamp(1rem, 3vh, 1.8rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
  z-index: 50;
}

.wa-btn {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #1FAF5E;
  color: #fff;
  box-shadow: 0 12px 28px -10px rgba(31, 175, 94, 0.7);
  transition: transform 0.25s ease;
}

.wa-btn:hover { transform: scale(1.07); }

.wa-btn svg { width: 30px; height: 30px; }

.wa-bubble {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px 14px 4px 14px;
  padding: 1rem 1.2rem;
  max-width: 240px;
  font-size: 0.92rem;
  color: var(--ink);
  box-shadow: 0 16px 40px -18px rgba(13, 60, 120, 0.4);
  animation: wa-in 0.4s ease both;
}

.wa-bubble a {
  display: inline-block;
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--azure-strong);
  text-decoration: none;
}

.wa-bubble a:hover { text-decoration: underline; }

.wa-bubble-close {
  position: absolute;
  top: -9px;
  left: -9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.wa-bubble-close svg { width: 11px; height: 11px; }

@keyframes wa-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======= Animação de entrada ======= */

.intro,
.panel {
  animation: rise 0.7s ease both;
}

.panel--medico { animation-delay: 0.12s; }
.panel--nao-medico { animation-delay: 0.24s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======= Movimento reduzido ======= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ======= Responsivo ======= */

@media (max-width: 960px) {
  .portal { grid-template-columns: 1fr; }
  .panel { min-height: 0; }
  .contact { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .topnav a:not(.topnav-phone) { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
