/* =====================================================================
   XII CEMED — Congresso dos Estudantes de Medicina da PUCPR
   Design tokens
   Paleta derivada da logo: verde floresta profundo (silhueta do portão)
   + verde médio (letras) + pergaminho (fundo claro) + tinta (texto)
   ===================================================================== */

:root{
  /* cor */
  --forest-deep:   #0c3a20;
  --forest:        #1f7a3d;
  --forest-bright: #33a35a;
  --forest-mist:   #e8f2ea;
  --parchment:     #f7f4ec;
  --parchment-2:   #efe9da;
  --ink:           #16251a;
  --ink-soft:      #46564a;
  --gold:          #b8934a;

  /* azul-marinho — herdado da identidade do CONEM, parceiro do congresso */
  --navy-deep:     #0e1a3a;
  --navy:          #1c3466;
  --navy-bright:   #35529e;

  --bg:            var(--parchment);
  --bg-alt:        var(--parchment-2);
  --surface:       #ffffff;
  --text:          var(--ink);
  --text-soft:     var(--ink-soft);
  --border:        rgba(22, 37, 26, 0.12);
  --shadow:        0 20px 45px -25px rgba(12, 58, 32, 0.45);

  --brand:         var(--forest);
  --brand-strong:  var(--forest-deep);
  --brand-bright:  var(--forest-bright);

  /* tipografia */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* layout */
  --max-width: 1180px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-arch: 999px 999px 14px 14px;
  --header-h: 84px;

  color-scheme: light;
}

html[data-theme="dark"]{
  --bg:            #0d1712;
  --bg-alt:        #101d16;
  --surface:       #142219;
  --text:          #eef2ee;
  --text-soft:     #a9bcae;
  --border:        rgba(238, 242, 238, 0.12);
  --shadow:        0 25px 60px -30px rgba(0, 0, 0, 0.7);

  --brand:         var(--forest-bright);
  --brand-strong:  #2a9350;
  --brand-bright:  #4fc077;

  color-scheme: dark;
}

/* =====================================================================
   Reset / base
   ===================================================================== */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; max-width: 100%; overflow-x: hidden; }
body{
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background-color .35s ease, color .35s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
img{ max-width: 100%; display: block; }
h1, h2, h3, h4{ font-family: var(--font-display); margin: 0; }
p{ margin: 0; }
ul{ list-style: none; margin: 0; padding: 0; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; cursor: pointer; }
input, select, textarea{ font: inherit; }

.skip-link{
  position: absolute; left: -999px; top: 0;
  background: var(--brand-strong); color: #fff;
  padding: .75rem 1.25rem; border-radius: 0 0 var(--radius-sm) 0;
  z-index: 999;
}
.skip-link:focus{ left: 0; }

:focus-visible{
  outline: 3px solid var(--brand-bright);
  outline-offset: 3px;
}

/* =====================================================================
   Utilities
   ===================================================================== */
.section{ padding: clamp(2.75rem, 8vw, 7rem) clamp(1.1rem, 4vw, 1.5rem); }
.section-alt{ background: var(--bg-alt); }
.section-inner{ max-width: var(--max-width); margin: 0 auto; }
.section-inner-narrow{ max-width: 760px; }

.section-eyebrow{
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--brand);
  margin-bottom: .9rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--brand);
}
.section-eyebrow-invert{ color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.5); }

.section-title{
  font-size: clamp(1.65rem, 3.6vw, 2.7rem);
  font-weight: 600;
  line-height: 1.2;
  max-width: 18ch;
  margin-bottom: 1.3rem;
}
.section-title-invert{ color: #fff; }

.section-lede{
  font-size: clamp(1rem, 2.4vw, 1.08rem);
  color: var(--text-soft);
  max-width: 62ch;
  line-height: 1.7;
}
.section-lede-invert{ color: rgba(255,255,255,.82); }

/* Logo swap por tema */
.logo-for-dark{ display: none; }
html[data-theme="dark"] .logo-for-light{ display: none; }
html[data-theme="dark"] .logo-for-dark{ display: block; }

/* =====================================================================
   Botões
   ===================================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .95rem 1.9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .98rem;
  border: 2px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
  min-height: 48px;
}
.btn:hover{ transform: translateY(-2px); }
.btn-primary{
  background: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover{ background: var(--bg); }
.btn-outline{
  background: transparent;
  color: var(--brand-strong);
  border-color: var(--brand-strong);
}
html[data-theme="dark"] .btn-outline{ color: var(--brand-bright); border-color: var(--brand-bright); }
.btn-outline:hover{ background: var(--brand-strong); color: #fff; }
.btn-invert{
  background: #fff;
  color: var(--forest-deep);
}
.btn-invert:hover{ background: var(--gold); color: #fff; }
.btn-small{ padding: .55rem 1.1rem; font-size: .85rem; min-height: 40px; }
.btn-wide{ width: 100%; }

/* =====================================================================
   Cabeçalho
   ===================================================================== */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease, background-color .3s ease;
}
.site-header.is-scrolled{
  border-bottom-color: var(--border);
  box-shadow: 0 12px 30px -22px rgba(0,0,0,.35);
}
.header-inner{
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.brand{ display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand-logo{ height: 55px; width: auto; flex-shrink: 0; }
.brand-logo-conem{ height: 40px; width: auto; flex-shrink: 0; }
.brand-divider{
  font-size: 1.1rem; color: var(--text-soft); font-weight: 300; line-height: 1;
}

.main-nav{ display: flex; gap: 2rem; }
.main-nav a{
  font-weight: 600; font-size: .95rem; color: var(--text-soft);
  position: relative; padding: .3rem 0;
}
.main-nav a:hover{ color: var(--brand-strong); }
html[data-theme="dark"] .main-nav a:hover{ color: var(--brand-bright); }
.main-nav a::after{
  content:""; position:absolute; left:0; right:100%; bottom:-2px; height:2px;
  background: var(--brand); transition: right .25s ease;
}
.main-nav a:hover::after{ right: 0; }

.header-actions{ display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

.theme-toggle{
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-strong);
  flex-shrink: 0;
}
.theme-toggle svg{ width: 20px; height: 20px; }
.theme-toggle .icon-moon{ display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display: block; }
html[data-theme="dark"] .theme-toggle{ color: var(--brand-bright); }

.nav-toggle{
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.nav-toggle span{ width: 18px; height: 2px; background: var(--text); margin: 0 auto; transition: transform .25s ease, opacity .25s ease; }
.nav-toggle.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2){ opacity: 0; }
.nav-toggle.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* =====================================================================
   Hero — motivo do portão/arco da logo
   ===================================================================== */
.hero{
  position: relative;
  padding: clamp(2.75rem, 9vw, 6.5rem) 1.5rem clamp(3rem, 8vw, 6rem);
  text-align: center;
  overflow: hidden;
  background: linear-gradient(90deg, rgb(3 51 25) 0%, /* rgb(12 83 51 / 0) 19%,*/ rgba(14, 26, 58, 1) 100%);}
html[data-theme="dark"] .hero{
  /*background:*/
  /*  radial-gradient(50% 55% at 50% 0%, rgba(51,163,90,.14), transparent 70%),*/
  /*  radial-gradient(50% 40% at 88% 8%, rgba(53, 82, 158, .16), transparent 70%);*/
}
.hero-arch{
  position: absolute; left: 50%; top: -140px; transform: translateX(-50%);
  width: 640px; height: 640px;
  border-radius: 50%;
  border: 1px solid var(--border);
  opacity: .5;
}
.hero-arch::before, .hero-arch::after{
  content:""; position: absolute; inset: 60px; border-radius: 50%; border: 1px solid var(--border);
}
.hero-arch::after{ inset: 120px; }
.hero-inner{ position: relative; max-width: 760px; margin: 0 auto; }
.eyebrow{
  display: inline-block; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  font-size: .82rem; color: var(--brand-strong); margin-bottom: 1.6rem;
}
html[data-theme="dark"] .eyebrow{ color: var(--brand-bright); }
.hero-logo{ height: clamp(110px, 28vw, 190px); width: auto; margin: 0 auto 1.2rem; }
.hero-realization{
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  margin: 0 auto 2rem;
  flex-wrap: wrap;
}
.hero-realization-label{
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-soft);
}
.hero-realization-logo{ height: 34px; width: auto; }
.hero-lede{ font-size: clamp(1rem, 3vw, 1.15rem); color: var(--text-soft); line-height: 1.75; margin: 0 auto 2.2rem; max-width: 58ch; }

.hero-meta{
  display: flex; align-items: center; justify-content: center; gap: 1.6rem;
  flex-wrap: wrap;
  margin-bottom: 2.6rem;
  row-gap: 1.2rem;
}
.hero-meta-item{ display: flex; flex-direction: column; gap: .2rem; text-align: left; min-width: 0; }
.hero-meta-label{ font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-soft); font-weight: 700; }
.hero-meta-value{ font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.hero-meta-divider{ width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }

.hero-cta{ display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; width: 100%; }

.partnership-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-direction: row;
  flex-wrap: wrap;
}

.partnership-logo-1 {
  height: clamp(90px, 22vw, 150px);
  width: auto;
  object-fit: contain;
}

.partnership-x {
  font-size: 24px;
  font-weight: bold;
}
.partnership-logo-2 {
  height: clamp(64px, 15vw, 100px);
  width: auto;
  object-fit: contain;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .partnership-container {
    flex-direction: column; /* Coloca um em cima do outro */
    gap: 10px; /* Reduz o espaço entre eles */
  }
}
/* =====================================================================
   Sobre
   ===================================================================== */
.about-grid{ display: grid; gap: 1.4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.about-text{ font-size: 1.05rem; color: var(--text-soft); line-height: 1.8; }
.about-stats{ grid-column: 1 / -1; display: flex; gap: clamp(1.5rem, 5vw, 4rem); margin-top: 1rem; flex-wrap: wrap; }
.stat{ display: flex; flex-direction: column; gap: .2rem; }
.stat-number{ font-family: var(--font-display); font-size: clamp(1.9rem, 6vw, 2.4rem); font-weight: 700; color: var(--brand-strong); }
html[data-theme="dark"] .stat-number{ color: var(--brand-bright); }
.stat-label{ font-size: .88rem; color: var(--text-soft); }

/* =====================================================================
   Cards de programação
   ===================================================================== */
.programacao{
  background: linear-gradient(90deg, rgb(3 51 25) 0%, /* rgb(12 83 51 / 0) 19%,*/ rgba(14, 26, 58, 1) 100%);}


.card-grid{
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.prog-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 5vw, 2rem) clamp(1.3rem, 4vw, 1.7rem) 1.7rem;
  display: flex; flex-direction: column; gap: .9rem;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
.prog-card:hover{ transform: translateY(-6px); }
.prog-card-numeral{
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: .05em;
}
.prog-card h3{ font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.prog-card p{ color: var(--text-soft); font-size: .96rem; line-height: 1.65; flex: 1; }
.prog-card-tag{
  align-self: flex-start;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand-strong); background: var(--forest-mist);
  padding: .3rem .7rem; border-radius: 999px;
}
html[data-theme="dark"] .prog-card-tag{ color: var(--brand-bright); background: rgba(51,163,90,.14); }
.card-more{
  align-self: flex-start;
  font-weight: 700; font-size: .9rem; color: var(--brand-strong);
  display: inline-flex; align-items: center; gap: .35rem;
  border: none; background: none; padding: .3rem 0; margin-top: .3rem;
  min-height: 44px;
}
html[data-theme="dark"] .card-more{ color: var(--brand-bright); }
.card-more svg{ width: 16px; height: 16px; transition: transform .2s ease; }
.card-more:hover svg{ transform: translateX(3px); }

/* =====================================================================
   Calendário
   ===================================================================== */
.calendar{
  margin-top: 2.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.1rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}
.calendar-toolbar{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.4rem;
  gap: .75rem;
}
.calendar-month{ font-size: clamp(1.02rem, 3.6vw, 1.2rem); font-weight: 600; }
.calendar-nav{
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--text);
  flex-shrink: 0;
}
.calendar-nav svg{ width: 18px; height: 18px; }
.calendar-nav:hover{ border-color: var(--brand); color: var(--brand-strong); }

.calendar-grid{
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(4px, 1.2vw, 8px);
}
.calendar-cell{
  aspect-ratio: auto;
  min-height: clamp(48px, 13vw, 92px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: .5rem .2rem;
  font-size: clamp(.78rem, 2.6vw, .95rem);
  transition: background-color .2s ease, border-color .2s ease, transform .15s ease;
}
.cell-weekday{
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-soft);
}
.calendar-cell.is-selected .cell-weekday{ color: rgba(255,255,255,.75); }
.calendar-cell.is-empty{ visibility: hidden; }
.calendar-cell:not(.is-empty):hover{ background: var(--bg-alt); }
.calendar-cell.has-events{ font-weight: 700; color: var(--brand-strong); cursor: pointer; border-color: var(--brand); }
html[data-theme="dark"] .calendar-cell.has-events{ color: var(--brand-bright); }
.calendar-cell.is-selected{
  background: var(--brand-strong); color: #fff !important;
  transform: translateY(-1px);
}
.calendar-cell.is-selected .cell-dots i{ background: #fff; }
.cell-dots{ display: flex; gap: 3px; }
.cell-dots i{
  display: block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand-strong);
}
html[data-theme="dark"] .cell-dots i{ background: var(--brand-bright); }

.day-panel{
  margin-top: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem clamp(1.1rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}
.day-panel-title{ font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.day-events{ display: flex; flex-direction: column; gap: .6rem; }
.day-event-btn{
  width: 100%;
  display: flex; align-items: flex-start; gap: .5rem 1rem;
  flex-wrap: wrap;
  text-align: left;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  color: var(--text);
}
.day-event-btn:hover{ border-color: var(--brand); }
.day-event-time{
  font-family: var(--font-display); font-weight: 700; color: var(--brand-strong);
  font-size: .95rem; white-space: nowrap;
}
html[data-theme="dark"] .day-event-time{ color: var(--brand-bright); }
.day-event-title{ font-weight: 600; font-size: .95rem; }
.day-event-tag{ font-size: .78rem; color: var(--text-soft); width: 100%; }
.day-panel-empty{ color: var(--text-soft); font-size: .95rem; }

/* =====================================================================
   Parceiros
   ===================================================================== */
.partners-grid{
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
  align-items: stretch;
}

.partner-card{
  background-color: rgba(0, 0, 0, 0.4); ;
  border: 0.1px solid #9f9f9f;
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .8rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.partner-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); }

.partner-logo{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  width: 100%;
}
.partner-logo img{ max-height: 100%; max-width: 100%; object-fit: contain; }

.partner-logo-placeholder{
  color: var(--text-soft); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; text-align: center;
}

.partner-desc{
  font-size: .88rem;
  line-height: 1.5;
  color: var(--text-soft);
  margin: 0;
}

.partner-link{
  margin-top: auto;
  font-size: .82rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  transition: background .2s ease, color .2s ease;
}
.partner-link:hover{ background: #2A9350FF; color: #ffffff}

/* =====================================================================
   Formulário de submissão
   ===================================================================== */
.submission-form{
  margin-top: 2.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.3rem, 5vw, 2.6rem);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 1.3rem;
}
.form-row{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.3rem; }
.form-field{ display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.form-field label{ font-weight: 700; font-size: .88rem; }
.form-field input, .form-field select, .form-field textarea{
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: .8rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  font-size: 16px; /* evita zoom automático no iOS */
  min-height: 48px;
  /* evita que o navegador dimensione o <select> pela opção mais longa */
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: auto;
}
.form-field textarea{ white-space: normal; overflow: auto; }
.form-field textarea{ min-height: 110px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus{
  border-color: var(--brand);
}
.form-status{ font-size: .92rem; font-weight: 600; min-height: 1.2em; }
.form-status.is-success{ color: var(--brand-strong); }
html[data-theme="dark"] .form-status.is-success{ color: var(--brand-bright); }
.form-status.is-error{ color: #c0392b; }



.author-input-row{
  display: flex;
  gap: .6rem;
  align-items: stretch;
}
.author-input-row input{
  flex: 1;
  min-width: 0;
  padding: .8rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.author-input-row input:focus{
  border-color: var(--brand);
  outline: none;
}
.author-input-row input::placeholder{
  color: var(--text);
  opacity: .5;
}

.btn-add-author, .btn-remove-author{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.btn-add-author{
  color: var(--brand-strong);
  border-color: var(--brand);
}
.btn-add-author:hover:not(:disabled){
  background: var(--brand);
  color: #fff;
}
.btn-add-author:disabled{
  opacity: .35;
  cursor: not-allowed;
}

.btn-remove-author{
  width: 44px;
  min-height: 100%;
  color:#c0392b;
  border-color: #c0392b;
}
.btn-remove-author:hover{
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.extra-authors{
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .7rem 1rem;
  /*margin-top: .7rem;*/
}

@media (max-width: 640px){
  .extra-authors{
    grid-template-columns: 1fr;
  }
  .card-grid{ grid-template-columns: 1fr; }
}

@media (min-width: 641px) and (max-width: 1024px){
  .card-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   Seção de inscrição (CTA)
   ===================================================================== */
.section-cta{
  position: relative;
  /*background: linear-gradient(160deg, var(--navy-deep), var(--forest-deep) 55%, var(--forest-deep));*/
  text-align: center;
  overflow: hidden;
}
.section-cta .section-inner{ display: flex; flex-direction: column; align-items: center; position: relative; }
.cta-arch{
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 520px; height: 520px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
}
.section-cta .section-title{ margin-bottom: .8rem; }
.section-cta .section-lede{ margin-bottom: 2rem; }
.cta-note{ margin-top: 1rem; font-size: .85rem; color:rgba(255,255,255,.6); }

/* =====================================================================
   Rodapé
   ===================================================================== */

.footer-inner{
  max-width: var(--max-width); margin: 0 auto; padding: 3rem clamp(1.1rem, 4vw, 1.5rem) 2.5rem;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem;
}
.footer-brand{ display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.footer-logos{ display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.footer-logo{ height: 60px; width: auto; align-self: flex-start; flex-shrink: 0; object-fit: contain; }
.footer-logo-conem{ height: 50px; margin-top:15px }
.footer-logo-cemed{ height: 70px }
.footer-logos .brand-divider{ color: rgba(247,244,236,.4); }
.footer-brand p{ color: rgba(247,244,236,.6); font-size: .92rem; max-width: 26ch; }
.footer-col h3{ font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; color: rgba(247,244,236,.5); }
.footer-col ul{ display: flex; flex-direction: column; gap: .6rem; font-size: .95rem; }
.footer-col a:hover{ color: #fff; }
.footer-bottom{
  border-top: 1px solid rgba(247,244,236,.12);
  padding: 1.3rem 1.5rem; text-align: center;
  font-size: .82rem; color: rgba(247,244,236,.5);
}

/* =====================================================================
   Modal (popup dos cards)
   ===================================================================== */
.modal-overlay{
  position: fixed; inset: 0; z-index: 900;
  background: rgba(9, 20, 12, .6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal-overlay.is-open{ opacity: 1; visibility: visible; }
.modal-card{
  background: var(--surface);
  border-radius: var(--radius-md);
  max-width: 620px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(1.6rem, 6vw, 3rem);
  position: relative;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.5);
  transform: translateY(18px) scale(.98);
  transition: transform .3s ease;
}
.modal-overlay.is-open .modal-card{ transform: translateY(0) scale(1); }
.modal-close{
  position: absolute; top: 1.2rem; right: 1.2rem;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.modal-close svg{ width: 18px; height: 18px; }
.modal-tag{
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand-strong); background: var(--forest-mist); padding: .3rem .7rem; border-radius: 999px;
  margin-bottom: 1rem;
}
html[data-theme="dark"] .modal-tag{ color: var(--brand-bright); background: rgba(51,163,90,.14); }
.modal-title{ font-size: clamp(1.3rem, 5vw, 1.6rem); font-weight: 600; margin-bottom: .6rem; }
.modal-meta{ font-weight: 700; color: var(--text-soft); font-size: .92rem; margin-bottom: 1.2rem; }
.modal-body{ color: var(--text-soft); line-height: 1.8; font-size: 1rem; white-space: pre-line; }
.modal-cta{ margin-top: 1.6rem; }

/* =====================================================================
   Toast
   ===================================================================== */
.toast{
  position: fixed;
  top: 1.5rem;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--ink);
  color: #fff;
  padding: .9rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .92rem;
  box-shadow: 0 20px 45px -20px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity .3s ease, transform .3s ease;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.toast.is-visible{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-success{
  background: var(--brand-strong);
}
html[data-theme="dark"] .toast.is-success{
  background: var(--brand-bright);
  color: var(--ink);
}

.toast.is-error{
  background: #c0392b;
}

@media (max-width: 520px){
  .toast{
    left: 1rem;
    right: 1rem;
    transform: translateY(-20px);
    width: auto;
  }
  .toast.is-visible{
    transform: translateY(0);
  }
}
/* =====================================================================
   Responsivo
   ===================================================================== */
@media (max-width: 860px){
  :root{ --header-h: 68px; }
  .main-nav{
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--surface);
    flex-direction: column; gap: 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    box-shadow: 0 20px 30px -22px rgba(0,0,0,.25);
  }
  .brand-logo-conem{margin-top: 8px}
  .main-nav.is-open{ opacity: 1; visibility: visible; transform: translateY(0); }
  .main-nav a{ padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: block; }
  .nav-toggle{ display: flex; }
  .header-actions .btn-small{ display: none; }
  .about-grid{ grid-template-columns: 1fr; }
  .about-stats{ gap: 1.75rem; }
  .form-row{ grid-template-columns: 1fr; }
  .footer-inner{ grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
  .hero-meta{ gap: 1.2rem 1.6rem; }
  .day-event-btn{ flex-direction: column; align-items: flex-start; gap: .3rem; }
  .day-event-time{ order: -1; }
}

@media (max-width: 640px){
  .card-grid{ grid-template-columns: 1fr; }
  .partners-grid{ grid-template-columns: repeat(2, 1fr); }
  .calendar-toolbar{ flex-wrap: wrap; }
  .calendar-month{ order: -1; width: 100%; text-align: center; margin-bottom: .3rem; }
}

@media (max-width: 520px){
  html{ font-size: 15px; }
  .hero{ padding-left: 1.1rem; padding-right: 1.1rem; }
  .hero-arch{ opacity: .3;}
  .hero-logo{ height: 100px; }

  .partnership-container{
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
  }
  .partnership-logo-1{ height: 165px; margin: 0 auto; }
  .partnership-logo-2{ height: 112px; margin: 0 auto; }
  .partnership-x{ font-size: 1.3rem; }

  .hero-meta{
    justify-content: center;
    text-align: center;
    gap: .9rem 1.4rem;
  }
  .hero-meta-item{ text-align: center; align-items: center; }
  .hero-meta-divider{ display: none; }

  .hero-cta .btn{ flex: 1 1 auto; }
  .brand-logo{ height: 32px; }
  .brand-logo-conem{ height: 38px;}
  .brand .logo-for-dark{height: 50px; margin-left: 10px}
  .brand-divider{ font-size: .9rem; }
  .nav-toggle{margin-right: 10px}
  .footer-inner{
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-brand{ align-items: center; text-align: center; }
  .footer-logos{
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    width: 100%;
  }
  .footer-col{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer-col ul{
    align-items: center;
  }
  .footer-logos .brand-divider{ order: 2; font-size: 1.3rem; }
  .footer-logo-cemed{ order: 1; height: 110px; align-self: center; }
  .footer-logo-conem{ order: 3; height: 80px; margin-top: 0; align-self: center; }
  .footer-brand p{ max-width: none; }

  .partners-grid{ grid-template-columns: 1fr; }
  .prog-card{ padding: 1.4rem 1.2rem 1.5rem; }
  .modal-overlay{ padding: 1rem; align-items: center; }
  .modal-card{
    max-width: 100%;
    max-height: 85vh;
    width: 100%;
    border-radius: var(--radius-md);
  }
  .toast{ left: 1rem; right: 1rem; transform: translateY(20px); width: auto; }
  .toast.is-visible{ transform: translateY(0); }
}

@media (max-width: 380px){
  .calendar-cell{ font-size: .72rem; min-height: 42px; }
  .cell-weekday{ font-size: .6rem; }
  .hero-meta-item{ min-width: 45%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "nome  email"
    "extra extra";
  column-gap: 24px;
  row-gap: 12px;
}

.field-nome  { grid-area: nome; }
.field-email { grid-area: email; }

.extra-authors {
  grid-area: extra;
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 por linha no desktop */
  gap: 12px;
}

/* cada item = input + botão X, lado a lado */
.author-item {
  display: flex;
  gap: 8px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nome"
      "extra"
      "email";
  }

  .extra-authors {
    grid-template-columns: 1fr; /* 1 por linha no mobile */
  }
}


terms-field{
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.terms-checkbox-label{
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  cursor: pointer;
}

.terms-checkbox-label input[type="checkbox"]{
  flex-shrink: 0;
  margin-top: .2rem;
  width: 19px;
  height: 19px;
  accent-color: var(--brand-strong);
  cursor: pointer;
}
html[data-theme="dark"] .terms-checkbox-label input[type="checkbox"]{
  accent-color: var(--brand-bright);
}

.terms-text{
  font-size: .92rem;
  line-height: 1.65;
  color: var(--text-soft);
}
.terms-text strong{
  display: block;
  margin-bottom: .3rem;
  color: var(--text);
  font-size: .95rem;
}

.terms-text-extra{
  display: none;
}
.terms-text-extra.is-expanded{
  display: inline;
}

.terms-toggle-btn{
  align-self: flex-start;
  margin-left: calc(19px + .8rem); /* alinha com o texto, não com o checkbox */
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: .85rem;
  min-height: auto;
}
html[data-theme="dark"] .terms-toggle-btn{ color: var(--brand-bright); }
.terms-toggle-btn:hover{ text-decoration: underline; }
.terms-toggle-btn svg{ transition: transform .2s ease; flex-shrink: 0; }
.terms-toggle-btn.is-expanded svg{ transform: rotate(180deg); }

/* estado de erro — quando a pessoa tenta enviar sem marcar */
.terms-field.has-error{
  border-color: #c0392b;
}

@media (max-width: 520px){
  .terms-toggle-btn{ margin-left: 0; }
}