@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,500;0,600;0,700;1,500&family=Karla:wght@400;500;600;700&display=swap');

:root {
  /* Vermelho e dourado — cores principais, tiradas do brasão */
  --vermelho-900: #4A1010;
  --vermelho-700: #8B1E1E;
  --vermelho-500: #B23B33;
  --dourado-600: #D98E04;
  --dourado-400: #EFA92E;
  --dourado-200: #FBDD9E;

  /* Verde — acento usado nas áreas de portal/dados (notas, faltas, pagamentos em dia) */
  --verde-900: #123726;
  --verde-700: #1F5C3F;
  --verde-500: #2F7A4D;
  --verde-100: #E4F0E7;

  --creme: #FFFCF3;
  --tinta: #2B1210;
  --cinza: #6B5C56;
  --alerta: #C0392B;
  --alerta-bg: #FBEAE8;
  --raio: 10px;
  --sombra: 0 2px 14px rgba(74, 16, 16, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Karla', sans-serif;
  color: var(--tinta);
  background: var(--creme);
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--vermelho-900);
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; max-width: 65ch; }

a { color: var(--vermelho-700); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--creme);
  border-bottom: 1px solid rgba(74, 16, 16, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark-img {
  height: 52px;
  width: auto;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--vermelho-900);
  line-height: 1.15;
}

nav.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--tinta);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

nav.main-nav a:hover { background: var(--dourado-200); }

nav.main-nav a.active {
  background: var(--vermelho-700);
  color: #fff;
}

nav.main-nav a.cta {
  background: var(--dourado-600);
  color: var(--tinta);
  font-weight: 700;
}

nav.main-nav a.cta:hover { background: var(--dourado-400); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(155deg, var(--vermelho-700) 0%, var(--vermelho-900) 100%);
  color: #fff;
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -140px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: var(--dourado-600);
  opacity: 0.18;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  position: relative;
}

.hero h1 { color: #fff; font-size: 3rem; }

.hero p.lead {
  color: var(--dourado-200);
  font-size: 1.15rem;
  max-width: 46ch;
}

.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.hero-stats {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--raio);
  padding: 24px;
}

.hero-stats dl { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0; }
.hero-stats dt { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 700; color: var(--dourado-400); }
.hero-stats dd { margin: 4px 0 0; font-size: 0.85rem; color: var(--dourado-200); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: 'Karla', sans-serif;
}

.btn-primary { background: var(--dourado-600); color: var(--tinta); }
.btn-primary:hover { background: var(--dourado-400); }

.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-outline:hover { border-color: #fff; }

.btn-green { background: var(--verde-700); color: #fff; }
.btn-green:hover { background: var(--verde-900); }

.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Sections ---------- */
section.section { padding: 60px 0; }
section.section.alt { background: var(--verde-100); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-head a { font-weight: 600; text-decoration: none; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: var(--raio);
  padding: 22px;
  box-shadow: var(--sombra);
  border-left: 4px solid var(--vermelho-700);
}

.card.urgent { border-left-color: var(--alerta); background: var(--alerta-bg); }

.card .date-tag {
  font-size: 0.8rem;
  color: var(--vermelho-700);
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.card.urgent .date-tag { color: var(--alerta); }

/* ---------- Timeline (datas importantes) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(74,16,16,0.1);
}

.timeline .tdate {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--vermelho-700);
}

/* ---------- Forms ---------- */
.form-card {
  background: #fff;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 32px;
  max-width: 560px;
}

label {
  display: block;
  font-weight: 600;
  margin: 16px 0 6px;
  font-size: 0.92rem;
}

label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid #E7D9C8;
  font-family: 'Karla', sans-serif;
  font-size: 0.95rem;
  background: var(--creme);
}

textarea { min-height: 120px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--vermelho-500);
  outline-offset: 1px;
}

.radio-row { display: flex; gap: 20px; margin-top: 8px; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.radio-row input { width: auto; }

.field-error { color: var(--alerta); font-size: 0.85rem; margin-top: 4px; }

.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-success { background: var(--verde-100); color: var(--verde-900); border: 1px solid var(--verde-500); }
.alert-error { background: var(--alerta-bg); color: var(--alerta); border: 1px solid var(--alerta); }

/* ---------- Portal / Admin ---------- */
.portal-shell { min-height: calc(100vh - 140px); padding: 48px 0; }

.auth-box {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 36px;
}

.overdue-banner {
  background: var(--alerta-bg);
  border: 2px solid var(--alerta);
  color: var(--alerta);
  border-radius: var(--raio);
  padding: 18px 22px;
  font-weight: 700;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Verde para "em dia" (positivo), vermelho de alerta para "atrasado" */
.status-em_dia { background: var(--verde-100); color: var(--verde-700); }
.status-atrasado { background: var(--alerta-bg); color: var(--alerta); }

table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra); }
table.data-table th, table.data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #F0EAE0; font-size: 0.92rem; }
table.data-table th { background: var(--verde-100); color: var(--verde-900); font-family: 'Fraunces', serif; }
table.data-table tr:last-child td { border-bottom: none; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

.panel { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 24px; margin-bottom: 24px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 16px; }
.inline-form > div { flex: 1; min-width: 140px; }
.inline-form label { margin-top: 0; }

.credential-box {
  background: var(--dourado-200);
  border: 2px dashed var(--vermelho-700);
  border-radius: var(--raio);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.credential-box strong { font-family: 'Fraunces', serif; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--tinta);
  color: var(--dourado-200);
  padding: 40px 0 24px;
  margin-top: 60px;
}

.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer a { color: var(--dourado-200); text-decoration: none; display: block; margin-bottom: 6px; font-size: 0.92rem; }
.site-footer a:hover { color: var(--dourado-400); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.8rem; color: rgba(255,255,255,0.55); }

/* ---------- Misc ---------- */
.muted { color: var(--cinza); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

@media (max-width: 800px) {
  .hero .container { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
  nav.main-nav { display: none; } /* simplificado; ver nota no README para menu mobile */
}
