:root {
  --bg: #070b14;
  --bg-soft: #0d1322;
  --card: #101a2d;
  --card-2: #0f1728;
  --txt: #e7ecf7;
  --muted: #9fb0ce;
  --accent: #34d399;
  --accent-2: #22c55e;
  --line: #23314d;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(circle at 10% -10%, rgba(59,130,246,.22), transparent 36%),
    radial-gradient(circle at 90% -20%, rgba(34,197,94,.18), transparent 34%),
    var(--bg);
  line-height: 1.55;
}

.no-scroll { overflow: hidden; }

.container { width: min(1120px, 92%); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.78);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.nav-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px 0;
}

.nav-aside {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  order: 3;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-switch a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.lang-switch a:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.35);
}

.lang-switch a.is-active {
  color: #fff;
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35);
}

/* Hambúrguer — só telemóvel; evita estilos globais de button */
.nav .nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav .nav-burger:hover {
  filter: none;
  background: rgba(51, 65, 85, 0.75);
  border-color: rgba(129, 140, 248, 0.4);
}

.nav .nav-burger:focus {
  outline: none;
}

.nav .nav-burger:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.65);
  outline-offset: 2px;
}

.nav-burger__lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 22px;
}

.nav-burger__bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav--open .nav-burger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav--open .nav-burger__bar:nth-child(2) {
  opacity: 0;
}

.nav--open .nav-burger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.nav-brand-mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #ec4899 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 8px 24px rgba(99, 102, 241, 0.35);
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.nav-brand-name {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #f8fafc;
}

.nav-brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.menu {
  order: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.menu a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.menu a:hover {
  color: #fff;
  background: rgba(51, 65, 85, 0.45);
  border-color: rgba(100, 116, 139, 0.35);
}

.nav-lang {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid rgba(71, 85, 105, 0.55);
}

.nav-lang-sep {
  width: 1px;
  height: 14px;
  background: rgba(100, 116, 139, 0.45);
  margin: 0 4px;
}

.nav-lang-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-lang-link:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.35);
}

.nav-lang-link.is-active {
  color: #fff;
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.nav-row > .brand {
  order: 1;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 1.12rem;
}

.card {
  background: linear-gradient(170deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.25;
}

h1 { font-size: clamp(1.45rem, 2.7vw, 2.1rem); }
h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  background: linear-gradient(180deg, rgba(20, 32, 56, .86), rgba(14, 24, 40, .9));
  border: 1px solid #2a3b5d;
  border-radius: 12px;
  padding: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #d7e2f8;
}

input, select, button {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #33496f;
  background: #0c1528;
  color: #fff;
}

input:focus, select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

button {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #042112;
  border: none;
  font-weight: 800;
  cursor: pointer;
}

button:hover { filter: brightness(1.06); }

.form-row { margin-bottom: 14px; }

.inline { display: flex; align-items: center; gap: 10px; }
.inline button { width: auto; min-width: 96px; white-space: nowrap; }

.alert {
  padding: 11px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-weight: 600;
}

.alert.error {
  background: #4c1111;
  border: 1px solid #7f1d1d;
  color: #fecaca;
}

.alert.success {
  background: #0c3d23;
  border: 1px solid #1e7d46;
  color: #bbf7d0;
}

.small {
  color: var(--muted);
  font-size: .94rem;
}

a { color: #8cc8ff; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

/* Telemóvel: ícone de 3 barras + menu recolhível */
@media (max-width: 768px) {
  .nav-row {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .nav .nav-burger {
    display: inline-flex;
  }

  .nav-row > .menu {
    position: fixed;
    left: 0;
    right: 0;
    top: 56px;
    bottom: 0;
    background: rgba(17, 17, 17, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 16px 16px 22px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  }

  .nav--open .nav-row > .menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-row > .menu a {
    width: 100%;
    text-align: center;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    transition: transform 0.18s ease;
  }

  .nav-aside .lang-switch--inline {
    display: none;
  }

  .menu .lang-switch--menu {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 8px;
  }
}

.menu a:hover {
  transform: translateY(-1px);
}

@media (max-width: 700px) {
  .container { width: min(1120px, 94%); }
  .nav-brand {
    justify-content: flex-start;
  }
  .nav-brand-tag {
    max-width: none;
  }
  .nav-end {
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(71, 85, 105, 0.35);
  }
  .menu {
    justify-content: center;
    gap: 6px;
  }
  .nav-lang {
    justify-content: center;
    padding-left: 0;
    border-left: none;
    padding-top: 4px;
  }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .inline { flex-direction: column; align-items: stretch; }
  .inline button { width: 100%; }
}
