/* Contacto local: la geometría se limita al borde; nunca cubre campos o acciones. */
html:has(.contact-dialog[open]) { overflow: hidden; }
.contact-dialog {
  width: min(600px, calc(100% - 40px));
  max-width: none;
  max-height: calc(var(--contact-height, 100dvh) - 40px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 16px;
  box-shadow: 0 24px 80px #101c2e40;
  overflow: hidden;
}
.contact-dialog[open] { display: flex; flex-direction: column; }
.contact-dialog::backdrop { background: #101c2eae; }
.contact-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 8px 32px; flex-shrink: 0; }
.contact-dialog-header .eyebrow { font-size: 11px; }
.contact-close { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 28px; line-height: 1; }
.contact-close:hover { background: #e9eef8; }
.contact-dialog-content { padding: 0 32px 28px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.contact-dialog h2 { font-size: 32px; line-height: 1.18; margin: 8px 0 12px; }
#contact-dialog-description { font-size: 16px; line-height: 1.5; }
.contact-trial-note { margin: 20px 0; padding: 12px 14px; background: var(--paper); border-left: 3px solid var(--blue); font-size: 13px; line-height: 1.5; }
.contact-field { margin-bottom: 16px; }
.contact-field label { display: block; margin-bottom: 7px; font-size: 15px; font-weight: 600; }
.contact-field label span { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.contact-field input, .contact-field textarea { display: block; width: 100%; padding: 11px 13px; border: 1px solid #7b8ba3; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; scroll-margin: 20px; }
.contact-field textarea { min-height: 112px; resize: vertical; }
.contact-field [aria-invalid="true"] { border-color: #a12732; }
.contact-hint { margin-top: 7px; font-size: 12px; line-height: 1.5; }
.contact-error { color: #a12732; font-size: 14px; margin-top: 6px; }
.contact-altcha { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.contact-altcha altcha-widget { display: block; }
.contact-altcha .contact-hint { margin-top: 8px; }
.contact-submit { width: 100%; }
.contact-newsletter { border-top: 1px solid var(--line); padding-top: 16px; margin: 20px 0; }
.contact-newsletter label { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; cursor: pointer; min-height: 44px; }
.contact-newsletter input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); }
.contact-newsletter strong { font-weight: 600; }
.contact-submit:disabled { opacity: .7; cursor: wait; transform: none; }
.contact-status { font-size: 14px; line-height: 1.5; }
.contact-status:not(:empty) { padding: 12px; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.contact-status[data-error="true"] { color: #a12732; border-color: #a12732; }
.contact-alternative { padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.contact-alternative a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.contact-alternative span { display: block; font-size: 12px; margin-top: 4px; }

/* Confirmación de envío: entrada animada, sin repetir los datos escritos. */
.contact-dialog .contact-success { position: relative; z-index: 1; padding: 12px 0 0; }
.contact-success-mark {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin-bottom: 18px;
  border-radius: 50%; background: #e8eefb; color: var(--blue);
}
.contact-success-mark svg { width: 26px; height: 26px; }
.contact-success-mark svg path { stroke-dasharray: 30; }
.contact-dialog .contact-success h2 { margin: 0 0 12px; font-size: 34px; }
.contact-success p { margin: 0; font-size: 16px; line-height: 1.55; }
.contact-success .contact-success-note { margin: 12px 0 24px; font-size: 14px; color: var(--muted); }
.contact-success .button { width: 100%; }

.contact-dialog.is-sent .contact-success-mark { animation: contact-mark-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.contact-dialog.is-sent .contact-success-mark svg path { stroke-dashoffset: 30; animation: contact-mark-draw .5s .18s ease-out forwards; }
.contact-dialog.is-sent .contact-success h2 { animation: contact-rise .5s .24s both; }
.contact-dialog.is-sent .contact-success p { animation: contact-rise .5s .34s both; }
.contact-dialog.is-sent .contact-success .button { animation: contact-rise .5s .44s both; }

@keyframes contact-mark-in { from { opacity: 0; transform: scale(.72); } }
@keyframes contact-mark-draw { to { stroke-dashoffset: 0; } }
@keyframes contact-rise { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .contact-dialog.is-sent .contact-success-mark,
  .contact-dialog.is-sent .contact-success h2,
  .contact-dialog.is-sent .contact-success p,
  .contact-dialog.is-sent .contact-success .button { animation: none; }
  .contact-dialog.is-sent .contact-success-mark svg path { animation: none; stroke-dashoffset: 0; }
}
@media (max-width: 600px) {
  .contact-dialog { width: calc(100% - 24px); max-height: calc(var(--contact-height, 100dvh) - 24px); top: calc(var(--contact-top, 0px) + 12px); bottom: auto; margin: 0 auto; border-radius: 12px; }
  .contact-dialog-header { padding: 10px 16px 6px 20px; }
  .contact-dialog-content { padding: 0 20px 24px; }
  .contact-dialog h2 { font-size: 28px; }
  .contact-trial-note { margin: 16px 0; }
  .contact-dialog .contact-success h2 { font-size: 28px; }
  .contact-success-mark { width: 48px; height: 48px; margin-bottom: 14px; }
}
