/* Tema e tokens visuais */
:root {
  color-scheme: light;
  --bg: #f8faf5;
  --bg-soft: #edf2e9;
  --surface: rgba(255, 255, 255, .78);
  --surface-strong: #ffffff;
  --surface-hover: #f8fcf7;
  --text: #17251f;
  --muted: #5c6b61;
  --primary: #157455;
  --primary-strong: #10543f;
  --button-bg: #157455;
  --button-hover: #10543f;
  --accent: #e89534;
  --accent-soft: rgba(232, 149, 52, .16);
  --border: rgba(23, 37, 31, .14);
  --shadow: 0 20px 55px rgba(30, 55, 42, .12);
  --nav-bg: rgba(248, 250, 245, .9);
  --project-bg: linear-gradient(145deg, #fff9ee, #e7f0e6);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14231c;
  --bg-soft: #1b2e24;
  --surface: rgba(27, 46, 36, .88);
  --surface-strong: #20362a;
  --surface-hover: #284332;
  --text: #f4f5e9;
  --muted: #b7c4b9;
  --primary: #78d4a8;
  --primary-strong: #9be3bd;
  --accent: #f1b85d;
  --accent-soft: rgba(241, 184, 93, .15);
  --border: rgba(255, 255, 255, .13);
  --shadow: 0 20px 55px rgba(0, 0, 0, .22);
  --nav-bg: rgba(20, 35, 28, .9);
  --project-bg: linear-gradient(145deg, #263929, #20362a);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Manrope, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg), var(--bg-soft));
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.container {
  width: min(1160px, 90%);
  margin: auto;
}

/* Navegação principal */
body > nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.logo {
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.logo span {
  color: var(--primary);
}

.logo-image {
  display: inline-flex;
  align-items: center;
  width: 150px;
}

.logo-image img {
  display: block;
  width: 100%;
  height: auto;
}

.nav-links,
.nav-actions,
.segmented {
  display: flex;
  align-items: center;
}

.nav-links {
  gap: 28px;
  list-style: none;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 700;
}

.nav-links a {
  transition: color .2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active,
.footer-links a.is-active {
  color: var(--primary);
}

.nav-actions {
  gap: 10px;
}

.segmented {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(12, 38, 46, .06);
}

.control {
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.control:hover,
.control:focus-visible {
  color: var(--text);
  transform: translateY(-1px);
}

.control.is-active {
  background: var(--button-bg);
  color: #ffffff;
}

.nav-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.nav-button {
  padding: 11px 18px;
  background: var(--text);
  color: var(--bg);
}

.nav-button:hover,
.nav-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(12, 38, 46, .14);
}

.menu {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.35rem;
}

/* Abertura da escola */
.hero {
  min-height: 82vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 76px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(transparent, #000 45%, transparent);
  opacity: .5;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: center;
  gap: 54px;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 780px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  margin-bottom: 28px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  color: var(--primary-strong);
  font-size: .78rem;
  font-weight: 800;
}

.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 14px var(--primary);
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", Manrope, sans-serif;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 28px;
  font-size: 4.55rem;
  line-height: .95;
}

h1 span:last-child {
  color: var(--primary);
}

.hero p {
  max-width: 680px;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 1.16rem;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  min-height: 50px;
  padding: 13px 22px;
  border: 1px solid var(--border);
}

.btn-primary {
  background: var(--button-bg);
  color: #ffffff;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 20%, transparent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-3px);
  background: var(--button-hover);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--primary) 26%, transparent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 42%, transparent);
  background: var(--surface-strong);
}

.hero-panel {
  min-height: 440px;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(145deg, #10543f, #157455 68%, #1b805f),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 255, 255, .08) 28px 29px);
  box-shadow: var(--shadow);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero-brand-mark {
  position: absolute;
  top: 24px;
  left: 24px;
  color: rgba(255, 255, 255, .12);
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: .8;
  z-index: -1;
}

.hero-orbit {
  display: none;
  position: absolute;
  top: 54px;
  right: 42px;
  width: 150px;
  height: 150px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: 50%;
  animation: spin-slow 18s linear infinite;
}

.hero-orbit span {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 24px color-mix(in srgb, var(--primary) 55%, transparent);
}

.hero-orbit span:nth-child(1) {
  top: -7px;
  left: 50%;
}

.hero-orbit span:nth-child(2) {
  right: 14px;
  bottom: 22px;
  background: var(--accent);
}

.hero-orbit span:nth-child(3) {
  bottom: 28px;
  left: 8px;
  width: 9px;
  height: 9px;
}

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

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
}

.metric strong {
  color: var(--accent);
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: 1.25rem;
}

.metric span {
  color: rgba(255, 255, 255, .84);
  font-size: .94rem;
  font-weight: 800;
  text-align: right;
}

section {
  padding: 108px 0;
}

.section-title {
  max-width: 720px;
  margin-bottom: 52px;
}

.section-title small,
.project span {
  color: var(--primary-strong);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: .74rem;
  font-weight: 800;
}

.section-title h2 {
  margin: 12px 0 15px;
  font-size: 3.1rem;
  line-height: 1.05;
}

.section-title p,
.about-text p,
.card p,
.cta p {
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 86px;
  align-items: center;
}

.about-text p {
  margin-bottom: 20px;
  font-size: 1.03rem;
}

.highlight {
  margin-top: 30px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 14px 14px 0;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(12, 38, 46, .08);
}

.highlight strong {
  display: block;
  margin-bottom: 3px;
}

.highlight span {
  color: var(--muted);
}

.services {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 40%, transparent), color-mix(in srgb, var(--primary) 6%, transparent));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Catálogo de formações */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.course-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 12px 30px rgba(20, 45, 31, .08);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: var(--shadow);
}

.course-level {
  margin-bottom: 12px;
  color: var(--primary-strong);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.course-card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.course-description {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .94rem;
}

.course-facts,
.course-topics {
  list-style: none;
}

.course-facts {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .88rem;
}

.course-facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.course-facts strong {
  color: var(--text);
  font-weight: 700;
}

.course-topics {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: .88rem;
}

.course-topics li {
  position: relative;
  padding-left: 17px;
}

.course-topics li::before {
  content: "";
  position: absolute;
  top: .55em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.course-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.course-price {
  display: grid;
  gap: 3px;
}

.course-price strong {
  color: var(--primary-strong);
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.course-price span {
  color: var(--muted);
  font-size: .8rem;
}

.course-cta {
  min-height: 44px;
  padding: 10px 14px;
  font-size: .88rem;
}

.course-cta[hidden] {
  display: none;
}

.courses-empty {
  padding: 22px 0;
  color: var(--muted);
}

/* Grelha de projectos */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(12, 38, 46, .08);
  position: relative;
  overflow: hidden;
  transition: transform .3s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: .78;
}

.card:hover {
  transform: translateY(-7px);
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
}

.icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 25px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-strong);
  font-size: 1.35rem;
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.16rem;
}

.card p {
  font-size: .94rem;
}

.project {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  background: var(--project-bg);
}

.project::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -42px;
  width: 150px;
  height: 150px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 50%;
}

.project > * {
  position: relative;
  z-index: 1;
}

.project span {
  margin-bottom: 7px;
}

.project h3 {
  font-size: 1.35rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.project-link:hover {
  opacity: 0.7;
}

.project-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Contacto e inscrição */
.cta {
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 34%),
    radial-gradient(circle at 88% 6%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 78%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  align-items: center;
  gap: 36px;
}

.cta-copy .tag {
  margin-bottom: 20px;
}

.cta h2 {
  margin-bottom: 18px;
  font-size: 3.2rem;
  line-height: 1;
}

.cta p {
  max-width: 600px;
}

.contact-card {
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 20px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), color-mix(in srgb, var(--primary) 10%, transparent));
  box-shadow: var(--shadow);
}

.contact-card strong,
.contact-card span {
  display: block;
}

.contact-card strong {
  margin-bottom: 8px;
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: 1.45rem;
  line-height: 1.15;
}

.contact-card span {
  margin-bottom: 20px;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-actions .btn {
  width: 100%;
}

.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  overflow: hidden;
  background: #128c4a;
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(37, 211, 102, .34);
  font-weight: 900;
  transition: transform .25s ease, box-shadow .25s ease;
}

.whatsapp-float img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.45);
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 22px 52px rgba(37, 211, 102, .44);
}

.whatsapp-float[hidden] {
  display: none;
}

footer {
  padding: 45px 0;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.copyright {
  margin-top: 5px;
  font-size: .85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 600;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
}

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

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: .9rem;
  font-weight: 700;
}

.social a {
  transition: color .2s ease;
}

.social a:hover,
.social a:focus-visible {
  color: var(--primary);
}

/* Animações de entrada e adaptação a ecrãs */
.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .nav-inner {
    gap: 14px;
  }

  .nav-links,
  .nav-button {
    display: none;
  }

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

  .menu {
    display: grid;
    place-items: center;
  }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 76px;
    left: 0;
    width: 100%;
    padding: 12px 5%;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.mobile-open li {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
  }

  .hero-grid,
  .about,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  .cta-grid {
    gap: 24px;
  }

  .hero {
    min-height: auto;
    padding: 132px 0 80px;
  }

  .hero-panel {
    min-height: 320px;
  }

  .hero-brand-mark {
    font-size: 3.6rem;
  }

  .hero-orbit {
    width: 118px;
    height: 118px;
    right: 28px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 3.8rem;
  }

  .section-title h2,
  .cta h2 {
    font-size: 2.7rem;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 32px, 1160px);
  }

  .nav-inner {
    min-height: 70px;
  }

  .logo {
    font-size: 1.24rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .segmented {
    gap: 2px;
    padding: 3px;
  }

  .control {
    min-width: 30px;
    height: 30px;
  }

  .menu {
    width: 38px;
    height: 38px;
  }

  .nav-links.mobile-open {
    top: 70px;
  }

  .hero {
    padding-top: 120px;
  }

  .hero-grid {
    gap: 34px;
  }

  h1 {
    font-size: 2.65rem;
  }

  .hero-brand-mark {
    font-size: 2.8rem;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .section-title h2,
  .cta h2 {
    font-size: 2.1rem;
  }

  .hero p {
    font-size: 1.04rem;
  }

  .btn {
    width: 100%;
  }

  section {
    padding: 78px 0;
  }

  .card,
  .course-card,
  .hero-panel,
  .contact-card {
    border-radius: 14px;
    padding: 22px;
  }

  .whatsapp-float {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }

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

  .social {
    justify-content: center;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card,
  .btn,
  .control,
  .nav-button,
  .whatsapp-float {
    transition: none;
  }

  .hero-orbit {
    animation: none;
  }
}