/* ==========================================================================
   MIG EVENTOS — Paleta oficial baseada no logo (azul royal, azul médio, ciano)
   Edite as cores abaixo diretamente no GitHub se precisar ajustar o tema.
   ========================================================================== */
:root {
  font: 16px/1.5 "DM Sans", system-ui, -apple-system, sans-serif;
  --brand: #013298;
  --brand-mid: #0172c2;
  --brand-cyan: #00cdfe;
  --brand-accent: #ff7a00;
  --surface: #f4faff;
  --line: #c5dff2;
  --text-muted: #3c5873;
  color: var(--brand);
  background: var(--surface);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(1160px, 92%);
  margin: auto;
}

.bar,
.row,
.actions,
nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bar,
.row {
  justify-content: space-between;
}

/* Cabeçalho e logo oficial em formato retangular sem corte circular */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

header .bar {
  min-height: 76px;
  padding: 8px 0;
}

.brand {
  font: 700 1.5rem system-ui, sans-serif;
  letter-spacing: -0.03em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand .logo {
  height: 54px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(1, 50, 152, 0.16);
}

a {
  color: inherit;
}

/* Botões e controles */
.button,
button,
.outline {
  font: inherit;
  cursor: pointer;
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 9px;
  padding: 0.63rem 1rem;
  text-decoration: none;
  font-weight: 600;
}

.button {
  display: inline-block;
}

.outline,
.step,
.chip,
.muted {
  background: transparent;
  color: var(--brand);
  border-color: var(--line);
}

button:disabled {
  opacity: 0.48;
  cursor: default;
}

b#count {
  background: var(--brand-accent);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
}

/* Destaque principal com o degradê oficial do logo */
.hero {
  margin: 28px 0 46px;
  border-radius: 25px;
  background: linear-gradient(125deg, var(--brand) 0%, var(--brand-mid) 54%, var(--brand-cyan) 100%);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(1, 50, 152, 0.14);
}

.hero > div {
  padding: clamp(26px, 5vw, 72px);
  align-self: center;
  color: #ffffff;
}

.hero img {
  height: 100%;
  max-height: 460px;
  width: 100%;
  object-fit: cover;
}

.hero .button {
  background: #ffffff;
  color: var(--brand);
  border-color: #ffffff;
}

.hero .eyebrow {
  color: #ccf5ff;
}

.eyebrow,
small {
  font-weight: 600;
  letter-spacing: 0.035em;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}

h1,
h2,
h3 {
  font-family: Georgia, serif;
  font-weight: 500;
  line-height: 1.08;
  margin: 0.4em 0;
}

h1 {
  font-size: clamp(2.8rem, 6.2vw, 5.4rem);
  letter-spacing: -0.055em;
}

h1 em {
  color: #ccf5ff;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.045em;
}

h3 {
  font-size: 1.45rem;
}

.hero p:not(.eyebrow) {
  max-width: 36ch;
}

/* Cartões, painéis e formulários */
.dates,
.panel,
.card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 16px;
}

.dates,
.panel {
  padding: clamp(16px, 3vw, 32px);
}

.dates,
.fields {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dates {
  grid-template-columns: 1fr 1fr 1.4fr;
  align-items: center;
  margin: 20px 0;
}

.dates p,
small,
.card p,
form p {
  color: var(--text-muted);
}

small {
  display: block;
  font-size: 0.85rem;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.94rem;
  font-weight: 600;
}

input,
select,
textarea {
  font: inherit;
  color: var(--brand);
  border: 1px solid #93b1c9;
  border-radius: 7px;
  padding: 0.65rem;
  background: #ffffff;
  width: 100%;
  min-width: 0;
}

textarea {
  min-height: 70px;
}

form {
  display: grid;
  gap: 14px;
}

form > button {
  justify-self: start;
}

.chip {
  border-radius: 99px;
  font-size: 0.93rem;
}

.chip[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

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

.card {
  overflow: hidden;
}

.card img,
.blank {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: #d9f3ff;
}

.cardbody {
  padding: 16px;
}

.cardbody p {
  min-height: 3em;
}

.cardbody button {
  margin-top: 12px;
  width: 100%;
}

.panel {
  margin: 28px 0;
}

.row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.step {
  padding: 0.25rem 0.65rem;
}

.fields,
.actions {
  margin: 8px 0;
}

/* Painel administrativo */
.admin {
  max-width: 900px;
}

.admin nav {
  margin: 20px 0;
}

.admin details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.admin summary {
  cursor: pointer;
  font-weight: 650;
}

.admin form {
  margin: 14px 0;
}

footer {
  padding: 30px 0;
}

footer span {
  font: 1.3rem Georgia, serif;
}

#result,
#notice {
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats div {
  border-radius: 10px;
  background: #e4f6ff;
  padding: 12px;
}

.stats strong {
  display: block;
  font-size: 1.25rem;
}

[hidden] {
  display: none !important;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-mid);
  outline-offset: 3px;
}

/* Responsivo para tablet e celular */
@media (max-width: 820px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dates p {
    grid-column: 1 / -1;
    margin: 0;
  }

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

@media (max-width: 560px) {
  .hero {
    grid-template-columns: 1fr;
    margin: 18px 0 30px;
  }

  .hero img {
    max-height: 240px;
    object-position: 50% 52%;
  }

  .grid {
    gap: 10px;
  }

  .cardbody {
    padding: 10px;
  }

  .cardbody h3 {
    font-size: 1.22rem;
  }

  .cardbody button {
    font-size: 0.86rem;
    padding: 0.5rem;
  }

  .fields,
  .stats {
    grid-template-columns: 1fr;
  }

  .brand .logo {
    height: 44px;
  }

  .hero h1 br {
    display: none;
  }

  header .bar {
    min-height: 64px;
  }
}
