/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Shantell+Sans:wght@300;400;500;600;700;800&family=Rubik:wght@300;400;500;600;700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --header-height: 234px;
  --cor-destaque: #eb5676;
  --cor-fundo: #cbe9eb;
  --cor-header-bg: #1a2a4a;
  --cor-header-text: #ffffff;
  --cor-footer-bg: #1a2a4a;
  --cor-footer-text: #aab8cc;
  --cor-card-bg: #ffffff;
  --cor-sombra: rgba(0, 0, 0, 0.10);
  --cor-sombra-hover: rgba(0, 0, 0, 0.22);
  --raio-borda: 14px;
  --transicao: 0.28s ease;
}

body {
  font-family: 'Rubik', sans-serif;
  background-color: var(--cor-fundo);
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
header {
  background-color: transparent;
  background-image: url('../media/elements/header.png');
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: center top;
  color: var(--cor-header-text);
  padding: 18px 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  min-height: var(--header-height);
  display: flex;
  align-items: start;
}

.logo-link {
  display: inline-flex;
  line-height: 0;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1000px;
  margin: 0 auto;
}

.logo-header {
  height: 70px;
  width: auto;
  object-fit: contain;
}

header p.subtitulo {
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.80;
  letter-spacing: 0.4px;
  text-align: center;
  color: var(--cor-header-bg);
  font-family: 'Shantell Sans', cursive;
}

@media (max-width: 480px) {
  .logo-header { height: 60px; }
  header p.subtitulo { font-size: 1.2rem; }
  header {
    background-size: cover;
    background-position: center center;
  }
}

/* ===== MAIN ===== */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height)) 20px 48px;
}

main h2.instrucao {
  font-size: 1.15rem;
  color: #445;
  margin-bottom: 36px;
  text-align: center;
  font-weight: 400;
}

/* ===== GRID DE CARDS ===== */
.grid-idiomas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 900px;
  width: 100%;
}

/* ===== CARD ===== */
.card {
  background-color: var(--cor-card-bg);
  border-radius: var(--raio-borda);
  box-shadow: 0 4px 16px var(--cor-sombra);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 24px;
  gap: 14px;
  transition: transform var(--transicao), box-shadow var(--transicao);
  cursor: pointer;
  border: 2px solid transparent;
}

.card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 32px var(--cor-sombra-hover);
  border-color: #c8d4e8;
}

.card:focus {
  outline: 3px solid #4a7cc7;
  outline-offset: 3px;
}

.bandeira-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  border: 3px solid #e8eef8;
  transition: box-shadow var(--transicao), transform var(--transicao);
}

.card:hover .bandeira-img {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  transform: scale(1.07);
}

.card .nome-idioma {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: #1a2a4a;
  font-family: 'Shantell Sans', cursive;
}

.card .idioma-nativo {
  font-size: 0.9rem;
  color: #778;
  text-align: center;
}

/* ===== CORES POR IDIOMA ===== */
.card-pt { border-top: 4px solid #009c3b; }
.card-en { border-top: 4px solid #012169; }
.card-it { border-top: 4px solid #ce2b37; }
.card-ru { border-top: 4px solid #d52b1e; }
.card-es { border-top: 4px solid #c60b1e; }
.card-fr { border-top: 4px solid #002395; }

/* ===== FOOTER ===== */
footer {
  background-color: var(--cor-footer-bg);
  color: var(--cor-footer-text);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.85rem;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 700px) {
  .grid-idiomas {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  header h1 { font-size: 1.4rem; }
}

@media (max-width: 420px) {
  .grid-idiomas {
    grid-template-columns: repeat(2, 1fr);
  }
}
