:root{
  --blue:#17345e;
  --blue-2:#234a83;
  --gold:#f0b21a;
  --text:#17345e;
  --muted:#5c7191;
  --bg:#f5f7fb;
  --white:#ffffff;
  --shadow:0 12px 30px rgba(15,32,68,.08);
  --radius:20px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  color:var(--text);
  background:var(--bg);
}
img{max-width:100%;display:block}
a{text-decoration:none;color:inherit}
.container{width:min(1180px,92%);margin:0 auto}

.site-header{
  position:sticky;top:0;z-index:30;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(8px);
  box-shadow:0 10px 24px rgba(0,0,0,.05);
}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 0;
}
.brand-logo{height:74px;width:auto;max-width:100%}
.main-nav{display:flex;gap:24px;align-items:center;flex-wrap:wrap}
.main-nav a{font-weight:700;color:var(--blue)}
.main-nav a:hover{color:var(--gold)}

.hero{
  padding:58px 0 42px;
  background:linear-gradient(180deg,#ffffff 0%,#f1f5fb 100%);
}
.hero-grid{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:40px;
  align-items:center;
}
.hero-copy{
  max-width:720px;
  margin:0 auto;
  text-align:center;
}
.hero-copy h1{
  margin:0 0 10px;
  font-size:68px;
  line-height:1;
  color:var(--blue);
}
.hero-copy h2{
  margin:0 0 18px;
  font-size:34px;
  color:var(--blue);
}
.hero-copy p{
  margin:0 auto 26px;
  max-width:620px;
  font-size:23px;
  line-height:1.5;
  color:var(--muted);
}
.hero-actions{
  display:flex;
  justify-content:center;
  gap:14px;
  flex-wrap:wrap;
}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:14px 24px;
  border:none;border-radius:999px;
  font-weight:700;cursor:pointer;
}
.btn-primary{background:var(--gold);color:#fff}
.btn-secondary{background:var(--blue);color:#fff}
.hero-media img{
  width:100%;
  max-width:540px;
  margin:0 auto;
  border-radius:26px;
  box-shadow:0 22px 50px rgba(17,36,78,.18);
  object-fit:cover;
}

.stats{padding:16px 0 26px}
.stats-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
.stat-card{
  background:#fff;border-radius:18px;padding:28px 20px;text-align:center;box-shadow:var(--shadow)
}
.stat-number{
  display:block;font-size:40px;font-weight:800;color:var(--blue)
}
.stat-label{
  display:block;margin-top:8px;color:var(--muted);font-weight:700
}

.section{padding:76px 0}
.section-heading{
  text-align:center;max-width:760px;margin:0 auto 30px
}
.section-heading h2{margin:0 0 12px;font-size:40px;color:var(--blue)}
.section-heading p{margin:0;font-size:18px;color:var(--muted);line-height:1.6}

.services-grid,.news-grid,.legal-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
.service-card,.news-card,.legal-card,.contact-card{
  background:#fff;
  border-radius:18px;
  padding:24px;
  box-shadow:var(--shadow);
}
.service-card h3,.news-card h3,.legal-card h3,.contact-card h3{
  margin:0 0 10px;font-size:20px;line-height:1.35
}
.service-card p,.news-card p,.legal-card p,.contact-card p{
  margin:0;color:var(--muted);line-height:1.65
}

.news-card details{margin-top:14px}
.news-card summary{cursor:pointer;font-weight:700;color:var(--blue-2)}

.quote{
  background:var(--blue);
}
.quote-box{
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:26px;
  align-items:start;
}
.quote-copy h2,.quote-copy p{color:#fff}
.quote-copy h2{margin:0 0 12px;font-size:38px}
.quote-copy p{margin:0;line-height:1.7}
.quote-form{
  background:#fff;border-radius:22px;padding:24px;display:grid;gap:14px;box-shadow:var(--shadow)
}
.quote-form input,.quote-form textarea{
  width:100%;
  padding:14px 16px;border:1px solid #d7deea;border-radius:14px;
  font:inherit;
}
.quote-form button{width:100%}

.contact-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}
.social-links{
  display:flex;gap:12px;flex-wrap:wrap;margin-top:14px
}
.social-links a{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:110px;padding:12px 16px;border-radius:999px;
  background:#eef3fb;color:var(--blue);font-weight:700
}

.footer{
  background:#102746;color:#dfe8f6;padding:26px 0;margin-top:30px
}
.footer-inner{
  display:flex;justify-content:space-between;gap:20px;align-items:center;flex-wrap:wrap
}
.footer-links{
  display:flex;gap:16px;flex-wrap:wrap
}
.footer-links a{color:#dfe8f6}
.footer-links a:hover{color:#fff}

.page-hero{
  padding:44px 0 18px;
}
.page-hero-box{
  background:#fff;border-radius:22px;padding:28px;box-shadow:var(--shadow);text-align:center
}
.page-hero-box h1{margin:0 0 10px;font-size:42px}
.page-hero-box p{margin:0;color:var(--muted);line-height:1.7}

.legal-content{
  background:#fff;border-radius:22px;padding:30px;box-shadow:var(--shadow);line-height:1.8;color:#35506f
}
.legal-content h2{color:var(--blue);margin-top:0}
.legal-content h3{color:var(--blue)}

.admin-wrap{
  max-width:1100px;margin:0 auto;padding:40px 20px
}
.admin-card,.admin-panel{
  background:#fff;border-radius:20px;padding:26px;box-shadow:var(--shadow)
}
.admin-card{max-width:520px;margin:0 auto}
.admin-form{display:grid;gap:12px}
.admin-form input,.admin-form textarea{
  width:100%;padding:14px 16px;border:1px solid #d7deea;border-radius:14px;font:inherit
}
.admin-form button,.secondary-btn{
  padding:14px 18px;border:none;border-radius:14px;font-weight:700;cursor:pointer
}
.admin-form button{background:var(--gold);color:#fff}
.secondary-btn{background:var(--blue);color:#fff}
.admin-panel-header{
  display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:18px
}
.admin-error{color:#b00020;font-weight:700;margin-top:12px}
.admin-news-list{
  display:grid;gap:14px;margin-top:20px
}
.admin-news-item{
  border:1px solid #e1e8f2;border-radius:16px;padding:18px;background:#fafcff
}
.admin-actions{margin-top:12px}

@media (max-width: 960px){
  .hero-grid,.stats-grid,.services-grid,.news-grid,.legal-grid,.quote-box,.contact-grid{
    grid-template-columns:1fr;
  }
  .main-nav{display:none}
  .brand-logo{height:78px}
  .hero-copy h1{font-size:50px}
  .hero-copy h2{font-size:28px}
  .hero-copy p{font-size:19px}
}
.stat-number{transition:transform .3s ease}.stat-number.is-visible{transform:translateY(0)}



/* ===== Responsive improvements ===== */
html, body {
  overflow-x: hidden;
}

.container {
  width: min(1200px, calc(100% - 32px));
}

.brand-logo {
  max-width: 100%;
  height: auto;
}

.hero-grid,
.quote-box,
.contact-grid,
.stats-grid,
.services-grid,
.news-grid,
.legal-grid {
  align-items: stretch;
}

.hero-copy,
.section-heading,
.page-hero-box {
  word-wrap: break-word;
}

.quote-form,
.admin-form {
  width: 100%;
}

.quote-form input,
.quote-form textarea,
.admin-form input,
.admin-form textarea {
  min-width: 0;
}

.hero-media img {
  width: 100%;
  height: auto;
}

/* Ecrãs muito grandes */
@media (min-width: 1440px) {
  .container {
    width: min(1320px, calc(100% - 80px));
  }

  .hero-copy h1 {
    font-size: 78px;
  }

  .hero-copy h2 {
    font-size: 40px;
  }

  .hero-copy p {
    font-size: 25px;
    max-width: 700px;
  }

  .section-heading h2,
  .quote-copy h2,
  .page-hero-box h1 {
    font-size: 46px;
  }

  .service-card,
  .news-card,
  .contact-card,
  .legal-card {
    padding: 28px;
  }
}

/* Tablets / laptops médios */
@media (max-width: 1100px) {
  .brand-logo {
    height: 84px;
  }

  .hero {
    padding: 48px 0 34px;
  }

  .hero-grid {
    gap: 28px;
  }

  .hero-copy h1 {
    font-size: 56px;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .hero-copy p {
    font-size: 20px;
  }

  .services-grid,
  .news-grid,
  .legal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets pequenos */
@media (max-width: 820px) {
  .site-header {
    position: static;
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .main-nav {
    display: flex !important;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .main-nav a {
    font-size: 15px;
  }

  .brand-logo {
    height: 58px;
  }

  .hero-grid,
  .quote-box,
  .contact-grid,
  .stats-grid,
  .services-grid,
  .news-grid,
  .legal-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 36px 0 24px;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .hero-copy h2 {
    font-size: 26px;
  }

  .hero-copy p {
    font-size: 18px;
    max-width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 320px;
  }

  .section {
    padding: 54px 0;
  }

  .section-heading h2,
  .quote-copy h2,
  .page-hero-box h1 {
    font-size: 32px;
  }

  .quote-copy {
    text-align: center;
  }

  .contact-card,
  .service-card,
  .news-card,
  .legal-card,
  .stat-card {
    padding: 20px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Smartphones */
@media (max-width: 560px) {
  .container {
    width: min(100%, calc(100% - 24px));
  }

  .brand-logo {
    height: 52px;
  }

  .main-nav {
    gap: 10px;
  }

  .main-nav a {
    font-size: 14px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-copy h2 {
    font-size: 22px;
  }

  .hero-copy p {
    font-size: 16px;
    line-height: 1.6;
  }

  .btn {
    padding: 13px 18px;
    font-size: 15px;
  }

  .stat-number {
    font-size: 32px;
  }

  .stat-label {
    font-size: 15px;
  }

  .section-heading h2,
  .quote-copy h2,
  .page-hero-box h1 {
    font-size: 28px;
  }

  .section-heading p,
  .quote-copy p,
  .page-hero-box p {
    font-size: 16px;
  }

  .service-card h3,
  .news-card h3,
  .contact-card h3,
  .legal-card h3 {
    font-size: 18px;
  }

  .quote-form,
  .admin-card,
  .admin-panel,
  .legal-content,
  .page-hero-box {
    padding: 20px;
  }

  .social-links a {
    width: 100%;
  }
}

/* Smartphones muito pequenos */
@media (max-width: 380px) {
  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-copy h2 {
    font-size: 20px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .main-nav a {
    font-size: 13px;
  }

  .section-heading h2,
  .quote-copy h2,
  .page-hero-box h1 {
    font-size: 24px;
  }
}




/* ===== Floating client access button ===== */
.floating-client-access{
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 95;
}
.floating-client-access-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:220px;
  padding:20px 22px;
  border-radius:24px 0 0 24px;
  background:linear-gradient(180deg, #f0b21a 0%, #d99600 100%);
  color:#fff;
  text-align:center;
  box-shadow:0 20px 46px rgba(15,32,68,.26);
  border:3px solid rgba(255,255,255,.38);
  animation:clientAccessShake .8s infinite;
}
.floating-client-access-label{
  display:block;
  font-size:16px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  line-height:1.2;
}
.floating-client-access-strong{
  display:block;
  margin-top:8px;
  font-size:31px;
  line-height:1.02;
  font-weight:900;
}
.floating-client-access:hover .floating-client-access-inner{
  background:linear-gradient(180deg, #ffc52c 0%, #e1a300 100%);
}
@keyframes clientAccessShake{
  0%,100%{transform:translateX(0) rotate(0deg)}
  15%{transform:translateX(-3px) rotate(-1.4deg)}
  30%{transform:translateX(3px) rotate(1.4deg)}
  45%{transform:translateX(-4px) rotate(-1.8deg)}
  60%{transform:translateX(4px) rotate(1.8deg)}
  75%{transform:translateX(-2px) rotate(-1deg)}
  90%{transform:translateX(2px) rotate(1deg)}
}

/* ===== UI refinements: header + cookie bar ===== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(23,52,94,.08);
  box-shadow: 0 6px 18px rgba(15,32,68,.05);
}
.header-inner{
  min-height: 74px;
  padding: 8px 0;
}
.brand{
  display:flex;
  align-items:center;
  flex: 0 0 auto;
}
.brand-logo{
  height: 81px !important;
  width: auto !important;
  max-width: 420px;
  object-fit: contain;
}
.main-nav{
  display:flex !important;
  gap: 10px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.main-nav a{
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  transition: .2s ease;
}
.main-nav a:hover{
  background:#eef3fb;
  color: var(--blue);
}
.main-nav a[href="noticias.html"]{
  background:#17345e;
  color:#fff;
}
.main-nav a[href="noticias.html"]:hover{
  background:#234a83;
}

.cookie-banner{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15,32,68,.18);
  border: 1px solid rgba(23,52,94,.08);
  padding: 14px 16px;
  display: none;
}
.cookie-banner.show{
  display:block !important;
}
.cookie-inner{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
}
.cookie-left{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.cookie-icon{
  flex:0 0 auto;
  width:40px;
  height:40px;
  border-radius:999px;
  background:#f1f7ec;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
}
.cookie-text{
  color:#304866;
  line-height:1.55;
  font-size:15px;
  max-width:760px;
}
.cookie-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.cookie-btn{
  border:none;
  border-radius:10px;
  padding:12px 22px;
  font-weight:700;
  cursor:pointer;
  min-width:110px;
}
.cookie-btn.accept{
  background:#274f1f;
  color:#fff;
}
.cookie-btn.reject{
  background:#274f1f;
  color:#fff;
}
.cookie-btn.more{
  background:#f3f5f8;
  color:#304866;
}

@media (max-width: 820px){
  .header-inner{
    flex-direction:column;
    gap:10px;
    min-height:auto;
  }
  .brand-logo{
    height: 63px !important;
    max-width: 320px;
  }
  .main-nav{
    justify-content:center;
    gap:8px;
  }
  .main-nav a{
    padding:8px 12px;
    font-size:13px;
  }
  .cookie-inner{
    flex-direction:column;
  }
  .cookie-actions{
    width:100%;
    justify-content:stretch;
  }
  .cookie-btn{
    flex:1 1 140px;
  }
}


.home-icon{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  padding:0 !important;
  font-size:18px !important;
  line-height:1;
  background:#eef3fb;
  color:var(--blue) !important;
  border-radius:999px;
}
.home-icon:hover{
  background:#17345e;
  color:#fff !important;
}
.page-wrap-spacer{
  min-height:60vh;
}


.contact-top-btn{
  background: var(--gold);
  color:#fff !important;
  box-shadow: 0 8px 20px rgba(240,178,26,.28);
}
.contact-top-btn:hover{
  background:#dca112 !important;
  color:#fff !important;
}
@media (max-width: 820px){
  .contact-top-btn{
    width:100%;
    max-width:220px;
    justify-content:center;
  }
}


.share-icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border:none;
  border-radius:10px;
  background:#f1f4f8;
  color:#17345e;
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.share-icon-btn:hover{
  background:#e2e9f3;
}
.news-share-icons{
  display:flex;
  gap:8px;
  margin-top:14px;
  flex-wrap:wrap;
}


.social-icon-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:6px;
}
.social-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:10px;
  background:#eef3fb;
  color:#17345e;
  text-decoration:none;
  font-weight:700;
  font-size:14px;
}
.social-icon:hover{
  background:#dfe9f8;
}


.social-icon.official{
  width:44px;
  height:44px;
  background:#f4f7fb;
  border:1px solid #dce5f1;
  border-radius:12px;
}
.social-icon.official svg{
  width:20px;
  height:20px;
  fill:#17345e;
}
.social-icon.official:hover{
  background:#e8eef7;
  border-color:#cfd9e7;
}


@media (max-width: 980px) {
  .floating-client-access{
    right: 12px;
  }
  .floating-client-access-inner{
    width: 186px;
    padding: 18px 16px;
  }
  .floating-client-access-label{
    font-size: 14px;
  }
  .floating-client-access-strong{
    font-size: 26px;
  }
}

@media (max-width: 700px) {
  .floating-client-access{
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 106px;
    transform: none;
  }
  .floating-client-access-inner{
    width: 100%;
    border-radius: 22px;
    padding: 16px 18px;
    animation: clientAccessShakeMobile .8s infinite;
  }
  .floating-client-access-label{
    font-size: 13px;
  }
  .floating-client-access-strong{
    margin-top: 6px;
    font-size: 24px;
  }
}

@keyframes clientAccessShakeMobile{
  0%,100%{transform:translateY(0) rotate(0deg)}
  20%{transform:translateY(-1px) rotate(-.8deg)}
  40%{transform:translateY(1px) rotate(.8deg)}
  60%{transform:translateY(-1px) rotate(-.8deg)}
  80%{transform:translateY(1px) rotate(.8deg)}
}
