/* =========================================================
   Legal Factor — Página de Contacto
   Paleta e tipografia alinhadas com legalfactor.pt
   ========================================================= */

:root {
  /* Cores da marca (Elementor globals de legalfactor.pt) */
  --lf-white: #ffffff;
  --lf-accent: #9b1d1d;
  /* vermelho institucional */
  --lf-accent-dk: #7d0100;
  --lf-maroon: #540003;

  /* CTA (botão de envio) */
  --lf-cta: #36b920;
  --lf-cta-dk: #2c9a1a;
  --lf-cta-shadow: rgba(54, 185, 32, .32);
  --lf-cta-ring: rgba(54, 185, 32, .26);
  --lf-sand: #ada68b;
  /* secundária */
  --lf-gold: #cbab74;
  --lf-text: #3a3a3a;

  --lf-muted: #6b6b6b;
  --lf-line: #e6e2d8;
  --lf-bg: #ffffff;
  --lf-bg-alt: #faf8f4;
  --lf-error: #b3261e;
  --lf-success: #1f7a3d;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 4px rgba(58, 58, 58, .04), 0 12px 32px rgba(58, 58, 58, .08);
  --shadow-sm: 0 1px 2px rgba(58, 58, 58, .06), 0 6px 18px rgba(58, 58, 58, .06);
  --wrap: 1160px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--lf-text);
  background:
    radial-gradient(1100px 480px at 10% -8%, rgba(203, 171, 116, .20), transparent 60%),
    radial-gradient(900px 440px at 96% 2%, rgba(155, 29, 29, .09), transparent 62%),
    var(--lf-bg-alt);
  -webkit-font-smoothing: antialiased;
}

h1 {
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 800;
  letter-spacing: -.01em;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--lf-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  background: var(--lf-accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  transition: top .2s var(--ease);
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* ---------------- Botões ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  padding: 16px 28px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn-accent {
  background: var(--lf-cta);
  color: #fff;
  box-shadow: 0 1px 2px rgba(58, 58, 58, .08), 0 4px 12px var(--lf-cta-ring);
}

.btn-accent:hover {
  background: var(--lf-cta-dk);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--lf-cta-shadow);
}

.btn-accent:active {
  background: var(--lf-cta-dk);
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(58, 58, 58, .16);
}

.btn-accent:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-block {
  width: 100%;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--lf-line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  max-height: 56px;
  width: auto;
}

.brand-wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--lf-maroon);
}

.brand-wordmark span {
  color: var(--lf-gold);
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--lf-text);
  position: relative;
  padding: 6px 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--lf-accent);
  transition: width .2s var(--ease);
}

.site-nav a:hover {
  color: var(--lf-accent);
  text-decoration: none;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  width: 100%;
}

.site-nav a[aria-current="page"] {
  color: var(--lf-accent);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--lf-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--lf-text);
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------- Contacto ---------------- */
.contact {
  padding: clamp(48px, 7vw, 84px) 0 clamp(64px, 8vw, 100px);
}

.contact-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--lf-maroon);
  margin: 0 0 clamp(28px, 4vw, 44px);
}

.form-card {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--lf-line);
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 44px);
  box-shadow: var(--shadow);
}

/* ---------------- Formulário ---------------- */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--lf-text);
}

.req {
  color: var(--lf-accent);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  color: var(--lf-text);
  padding: 14px 16px;
  border: 1.5px solid var(--lf-line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 150px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a9a49a;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--lf-gold);
  box-shadow: 0 0 0 4px rgba(203, 171, 116, .2);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--lf-error);
}

.field.has-error input:focus,
.field.has-error textarea:focus {
  box-shadow: 0 0 0 4px rgba(179, 38, 30, .14);
}

.error {
  color: var(--lf-error);
  font-size: .8rem;
  margin: 6px 0 0;
}

.error:empty {
  display: none;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.counter {
  font-size: .78rem;
  color: var(--lf-muted);
  margin-top: 6px;
  white-space: nowrap;
}

.field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 24px;
}

.field-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--lf-accent);
  cursor: pointer;
  flex: 0 0 auto;
}

.field-check label {
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.55;
  margin: 0;
  color: var(--lf-muted);
  cursor: pointer;
}

.field-check .error {
  grid-column: 1 / -1;
}

.field-check.has-error input[type="checkbox"] {
  outline: 2px solid var(--lf-error);
  outline-offset: 2px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  border: 1px solid transparent;
}

.form-status.is-success {
  background: #eef7f1;
  border-color: #bfe0cb;
  color: var(--lf-success);
}

.form-status.is-error {
  background: #fdf0ef;
  border-color: #f2c9c6;
  color: var(--lf-error);
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 780px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--lf-line);
    box-shadow: var(--shadow);
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s var(--ease);
  }

  .site-nav.is-open {
    max-height: 400px;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
  }

  .site-nav li {
    border-bottom: 1px solid var(--lf-line);
  }

  .site-nav li:last-child {
    border-bottom: 0;
  }

  .site-nav a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
  }

  .site-nav a::after {
    display: none;
  }

  .brand-logo {
    max-height: 44px;
  }
}