/* ═══════════════════════════════════════════════
   MODAL  ·  Aviso de portfólio — entrada
   Portal da Conexão
   ═══════════════════════════════════════════════ */

/* ─── Overlay ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;      /* permite scroll se o modal for maior que a tela */
  animation: overlayIn 0.3s ease forwards;
}

.modal-overlay.closing {
  animation: overlayOut 0.28s ease forwards;
  pointer-events: none;
}

@keyframes overlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }

/* ─── Card ─── */
.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  animation: cardIn 0.4s cubic-bezier(.2,.65,.2,1) 0.06s forwards;
  /* Garante que o card nunca ultrapasse a altura da viewport */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px); /* dvh = dynamic viewport height (mobile-safe) */
  overflow-y: auto;
  margin: auto;          /* centraliza dentro do overlay flex mesmo com overflow-y:auto */
}

.modal-overlay.closing .modal {
  animation: cardOut 0.26s cubic-bezier(.4,0,1,1) forwards;
}

@keyframes cardIn  { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cardOut { to { opacity: 0; transform: translateY(20px) scale(0.97); } }

/* ─── Botão fechar ─── */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(249, 247, 242, 0.18);
  background: rgba(249, 247, 242, 0.08);
  color: rgba(249, 247, 242, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  padding: 0;
}

.modal-close:hover {
  background: rgba(249, 247, 242, 0.16);
  color: var(--cream);
  border-color: rgba(249, 247, 242, 0.35);
}

/* ════ HEADER escuro ════════════════════════════ */
.modal-header {
  background: var(--ink);
  padding: 40px 32px 30px;
  text-align: center;
}

/* Brandmark */
.modal-brandmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
}

.brand-logo-modal {
  height: 42px;
  width: auto;
  max-width: 100%;
  display: block;
  /* inverte para branco no header escuro */
  filter: brightness(0) invert(1);
}

/* Eyebrow */
.modal-badge {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(249, 247, 242, 0.45);
}

/* ════ BODY claro ════════════════════════════════ */
.modal-body {
  background: #fff;
  padding: 32px 32px 26px;
  text-align: center;
}

/* Texto do aviso */
.modal-disclaimer {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}

.modal-disclaimer b {
  color: var(--ink);
  font-weight: 700;
}

/* Divisor */
.modal-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0 18px;
}

/* Links de rodapé */
.modal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.modal-links a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--terra);
  text-decoration: none;
  border: none;
  transition: color 0.2s;
}

.modal-links a:hover { color: var(--terra-deep); }

.modal-links .modal-sep {
  color: var(--line-strong);
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

/* ─── Botões de ação ─── */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Botão primário: explorar */
.modal-btn-explore {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, transform 0.15s;
}

.modal-btn-explore:hover {
  background: var(--terra);
  transform: translateY(-1px);
}

/* Botão secundário: portfólio */
.modal-btn-portfolio {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.modal-btn-portfolio:hover {
  background: rgba(42, 40, 36, 0.04);
  border-color: var(--ink-soft);
  color: var(--ink);
}

/* ─── Responsivo ─── */
@media (max-width: 480px) {
  .modal-overlay { padding: 12px; }
  .modal-header  { padding: 28px 20px 20px; }
  .modal-body    { padding: 22px 20px 20px; }
  .modal-brand-name { font-size: 18px; }
  .brand-logo-modal { height: 34px; }
}
