/* Contact form submit button: expands to show a spinner while sending and a check when the message is accepted. */
.contact-form .pill.expand{
  --button-height:48px;
  position:relative;
  overflow:hidden;
  gap:0;
  outline-offset:5px;
}

/* 3D style: a solid "ledge" under the face plus a soft drop shadow. The button lives in the dark
   "Hablemos" section, so its colors are fixed (brand yellow, lighter on hover).
   The ledge is a darker tone of the current background. */
.contact-hub .contact-form .pill.expand{
  --btn-bg:#ffd000;
  --btn-fg:#141414;
  --btn-sh:color-mix(in srgb,var(--btn-bg) 55%,#000);
  --btn-ease:cubic-bezier(.2,.7,.3,1);
  -webkit-appearance:none;
  appearance:none;
  border:0;
  background:var(--btn-bg);
  color:var(--btn-fg);
  user-select:none;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.1),0 6px 0 var(--btn-sh),0 11px 14px rgba(0,0,0,.22);
}
/* Keep padding in the transition list so the button opens and closes smoothly. */
.contact-form .pill.expand,
.contact-hub .contact-form .pill.expand:not(:disabled){
  transition:padding .3s,background .25s,color .25s,transform .18s var(--btn-ease),box-shadow .18s var(--btn-ease);
}
.contact-hub .contact-form .pill.expand:not(:disabled):hover{
  --btn-bg:#ffe27a;
  --btn-fg:#141414;
  transform:translateY(-2px);
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.1),0 8px 0 var(--btn-sh),0 13px 16px rgba(0,0,0,.22);
}
.contact-hub .contact-form .pill.expand:not(:disabled):active{
  transform:translateY(1px);
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.1),0 5px 0 var(--btn-sh),0 9px 11px rgba(0,0,0,.2);
}
/* Disabled (before the script is ready, or while sending): stays at rest, no lift. */
.contact-hub .contact-form .pill.expand:disabled,
.contact-hub .contact-form .pill.expand:disabled:hover,
.contact-hub .contact-form .pill.expand:disabled:active{
  transform:none;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.1),0 6px 0 var(--btn-sh),0 11px 14px rgba(0,0,0,.22);
}
.contact-hub .contact-form .pill.expand:focus-visible{outline:2px solid #f8cc45;outline-offset:5px}
/* Leave room so the ledge and shadow don't touch the status message below. */
.contact-form .pill.expand{margin-bottom:6px}
.contact-form .pill.expand .expand-label{font-size:inherit;white-space:nowrap}

.contact-form .pill.expand .expand-icon{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  width:var(--button-height);
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:inherit;
  border-left:1px solid currentColor;
  border-left-color:color-mix(in srgb,currentColor 30%,transparent);
  transform:translateX(calc(var(--button-height) + 1px));
  transition:transform .3s,border-left-color .2s;
  pointer-events:none;
}
.contact-form .pill.expand.no-divider .expand-icon{border-left-color:transparent}

.contact-form .pill.expand.loading{
  padding-right:calc(23px + var(--button-height));
}
.contact-form .pill.expand.loading .expand-icon{
  transform:translateX(0);
  transition:transform .3s .05s,border-left-color .2s;
}
/* While sending, keep the button looking active instead of the faded "disabled" style. */
.contact-hub .contact-form .pill.expand.loading:disabled{opacity:1;cursor:progress}

@keyframes expand-loader-rotate{
  from{transform:scale(.3) rotateZ(0deg)}
  to{transform:scale(.3) rotateZ(360deg)}
}
.contact-form .pill.expand .loader{
  --loader-size:52px;
  position:absolute;
  width:var(--loader-size);
  height:var(--loader-size);
  border:4px solid currentColor;
  border-left-color:transparent;
  border-right-color:transparent;
  border-radius:50%;
  opacity:0;
  animation:expand-loader-rotate 1.5s linear infinite;
  transition:opacity 1s .3s;
}
.contact-form .pill.expand.loading .loader{opacity:1}
.contact-form .pill.expand.loaded .loader{opacity:0;transition:opacity .2s}

.contact-form .pill.expand .expand-check{
  width:10px;
  height:10px;
  display:none;
  opacity:0;
  transform:scale(0) translateY(50px);
  transition:transform .3s,opacity .25s;
}
.contact-form .pill.expand.loaded .expand-check{display:block}
.contact-form .pill.expand.finished .expand-check{opacity:1;transform:scale(1.5) translateY(0)}

@media(max-width:760px){
  .contact-form .pill.expand{--button-height:44px}
  .contact-form .pill.expand.loading{padding-right:calc(20px + var(--button-height))}
}

@media(prefers-reduced-motion:reduce){
  .contact-hub .contact-form .pill.expand:not(:disabled):hover,
  .contact-hub .contact-form .pill.expand:not(:disabled):active{transform:none}
  .contact-form .pill.expand,
  .contact-form .pill.expand .expand-icon,
  .contact-form .pill.expand .expand-check{transition:none}
  .contact-form .pill.expand .loader{animation-duration:3s}
}

@media(forced-colors:active){
  .contact-hub .contact-form .pill.expand{border:1px solid ButtonBorder;background:ButtonFace;color:ButtonText;box-shadow:none}
  .contact-hub .contact-form .pill.expand:not(:disabled):hover,
  .contact-hub .contact-form .pill.expand:not(:disabled):active,
  .contact-hub .contact-form .pill.expand:disabled{box-shadow:none}
  .contact-hub .contact-form .pill.expand:focus-visible{outline:2px solid Highlight}
  .contact-hub .contact-form .pill.expand:disabled{color:GrayText;border-color:GrayText}
}
