/* Loading and recovery screens use the existing CatapultaPay palette. */
.site-loader[hidden] { display: none; }
.site-loader {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center; padding: 24px;
  background: #ffffff;
  color: #0a1628;
  transition: opacity .55s cubic-bezier(.65,0,.35,1), visibility .55s, filter .55s cubic-bezier(.65,0,.35,1);
}
.site-loader.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; filter: blur(10px); }
.loader-content { position: relative; width: min(280px, 80vw); text-align: center; transition: transform .55s cubic-bezier(.65,0,.35,1), opacity .4s ease .05s; }
.site-loader.is-leaving .loader-content { transform: scale(1.14); opacity: 0; }
.loader-status { display: flex; justify-content: center; }
.loader-glyph { width: 108px; height: 108px; overflow: visible; }
/* El drop-shadow se activa solo cuando el trazo ya terminó de dibujarse: un
   filter sobre un SVG que anima stroke-dashoffset fuerza repintar todo el
   grupo (sombra incluida) en cada frame, lo que se sentía como un "tirón"
   durante el dibujo del ícono. */
.site-loader.lg-dot-in .loader-glyph { filter: drop-shadow(0 12px 24px rgba(10,22,40,.1)); transition: filter .3s ease; }
.lg-arc {
  fill: none; stroke: url(#loaderBrand); stroke-linecap: round;
  transition: stroke-dashoffset .3s cubic-bezier(.65,0,.35,1);
}
.lg-arc:nth-child(2) { transition-delay: .1s; }
.lg-arc:nth-child(3) { transition-delay: .2s; }
.lg-arc:nth-child(4) { transition-delay: .3s; }
.lg-dot {
  fill: url(#loaderBrand); opacity: 0; transform: scale(0); transform-box: fill-box; transform-origin: center;
  transition: opacity .2s ease .55s, transform .25s cubic-bezier(.34,1.4,.6,1) .55s;
}
.site-loader.lg-dot-in .lg-dot { opacity: 1; transform: scale(1); }
.loader-brand {
  margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font-display, inherit);
  animation: brand-enter .35s cubic-bezier(.16,1,.3,1) .6s both;
}
.loader-brand-main { font-size: 2.2rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.loader-brand-sub { font-size: .64rem; font-weight: 600; letter-spacing: .24em; color: #4a6080; }
.loader-tagline {
  margin-top: 18px; font-size: .82rem; font-weight: 400; color: #5c7593; letter-spacing: .005em;
  animation: brand-enter .35s cubic-bezier(.16,1,.3,1) .7s both;
}
.title-word { display: inline-block; }
.recovery-page { min-height: 100svh; display: flex; flex-direction: column; }
.recovery-header { width: min(1200px, 88%); margin: 0 auto; padding: 28px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--color-borderW); }
.recovery-logo { width: 112px; height: auto; }
.recovery-header > span { font-size: .72rem; color: var(--color-muted); }
.recovery-main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6rem; width: min(1060px, 88%); margin: 60px auto; }
.recovery-art { position: relative; display: grid; place-items: center; padding: 10px 0; }

/* A printed POS receipt, not a generic tilted SaaS card: it ties the error
   state to what this product actually prints. Paper stays cream/ink in both
   themes (real thermal paper doesn't go dark-mode); the torn edge is a
   gradient trick, not an image. */
.receipt-frame { position: relative; width: min(290px, 84%); filter: drop-shadow(0 26px 46px rgba(0, 0, 0, .35)); }
.receipt-slot { position: relative; z-index: 2; height: 9px; margin: 0 16px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #050607, #1c1f24); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7); }
.receipt-slot::after { content: ''; position: absolute; inset: 3px 18%; background: #000; border-radius: 2px; }
.receipt-paper {
  position: relative;
  z-index: 1;
  margin-top: -4px;
  background: #F6F2E7;
  color: #23262E;
  padding: 34px 22px 0;
  font-family: var(--font-mono);
  transform: rotate(-2.2deg);
  transform-origin: top center;
  animation: receipt-print .9s cubic-bezier(.16, 1, .3, 1) backwards;
}
.receipt-paper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(20, 20, 10, .025) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.receipt-stamp-row { display: flex; justify-content: flex-end; margin: -10px 2px 2px; position: relative; z-index: 2; }
.receipt-stamp {
  border: 2.5px solid #B4790F;
  border-radius: 9px;
  padding: 4px 10px;
  color: #B4790F;
  background: rgba(180, 121, 15, .08);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .09em;
  transform: rotate(-6deg);
  white-space: nowrap;
}
.receipt-brand-row { display: flex; justify-content: space-between; align-items: baseline; font-size: .6rem; font-weight: 700; letter-spacing: .1em; }
.receipt-rule { margin: 13px 0; border-top: 1px dashed rgba(35, 38, 46, .32); }
.receipt-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: .66rem; letter-spacing: .03em; color: #5B5F6A; }
.receipt-row span:last-child { color: #23262E; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.receipt-total span:first-child { font-size: .66rem; font-weight: 700; letter-spacing: .09em; color: #5B5F6A; }
.receipt-code { font-size: clamp(2.5rem, 6vw, 3.1rem); font-weight: 700; letter-spacing: -.02em; }
.receipt-barcode {
  height: 30px;
  margin: 16px 0 8px;
  opacity: .82;
  background-image: repeating-linear-gradient(90deg,
    #23262E 0 2px, transparent 2px 4px,
    #23262E 4px 5px, transparent 5px 9px,
    #23262E 9px 12px, transparent 12px 13px,
    #23262E 13px 16px, transparent 16px 19px,
    #23262E 19px 20px, transparent 20px 24px);
}
.receipt-foot { display: block; padding-bottom: 14px; text-align: center; font-size: .54rem; letter-spacing: .18em; color: #8E8F84; }
.receipt-tear {
  height: 9px;
  margin: 0 16px;
  background-image:
    linear-gradient(-45deg, var(--color-bg) 9px, transparent 0),
    linear-gradient(45deg, var(--color-bg) 9px, transparent 0);
  background-size: 18px 18px;
  background-position: left bottom;
  background-repeat: repeat-x;
  transform: translateY(1px);
}
.recovery-copy h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.17; letter-spacing: -.035em; font-weight: 550; color: var(--color-white); margin-bottom: 22px; text-wrap: balance; }
.recovery-copy p { color: var(--color-muted); font-size: .95rem; max-width: 440px; margin-bottom: 30px; }
.recovery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.recovery-help { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; padding: 12px; text-underline-offset: 5px; }
.recovery-help:hover { text-decoration: underline; }
.recovery-footer { border-top: 1px solid var(--color-borderW); width: min(1200px, 88%); margin: 0 auto; padding: 22px 0; display: flex; justify-content: space-between; gap: 20px; color: var(--color-muted); font-size: .7rem; }
@keyframes brand-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes receipt-print { from { opacity: 0; transform: translateY(-58px) rotate(-2.2deg); } to { opacity: 1; transform: translateY(0) rotate(-2.2deg); } }
@media(max-width: 768px) {
  .recovery-header { padding-block: 20px; }
  .recovery-main { grid-template-columns: 1fr; gap: 10px; margin-block: 15px 45px; }
  .receipt-frame { width: min(260px, 78%); }
  .receipt-code { font-size: 2.5rem; }
  .receipt-stamp-row { margin-top: -8px; }
  .receipt-stamp { font-size: .52rem; padding: 4px 8px; }
  .receipt-brand-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .recovery-copy { text-align: center; }
  .recovery-copy p { margin-inline: auto; font-size: .87rem; }
  .recovery-actions { justify-content: center; }
  .recovery-actions .btn-primary { width: auto; }
  .recovery-footer { font-size: .72rem; }
}
@media(prefers-reduced-motion: reduce) {
  .site-loader { transition: none; }
  .site-loader.is-leaving { filter: none; }
  .receipt-paper { animation: none; }
  .loader-content { transition: none; }
  .site-loader.is-leaving .loader-content { transform: none; opacity: 1; }
  .lg-arc { transition: none; stroke-dashoffset: 0 !important; }
  .lg-dot { transition: none; opacity: 1; transform: scale(1); }
  .loader-brand, .loader-tagline { animation: none; }
}
