/* ===== MOM Animations — Biblioteca de animações de botão ===== */

/* ----- Base: estado de loading do botão ----- */
button.btnLoading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .85;
    cursor: not-allowed;
}

.momLoadingWrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ----- Texto com letras pulando ----- */
@keyframes momLetterJump {
    0%, 100% { transform: translateY(0); }
    5%        { transform: translateY(-5px); }
    12%       { transform: translateY(0); }
}

.momLoadingText {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.momLoadingText span {
    display: inline-block;
    animation: momLetterJump var(--mom-dur, 2.4s) ease-in-out infinite;
}

/* ===== ANIMAÇÃO: dots ===== */
@keyframes momDotOrbit {
    0%   { transform: rotate(0deg)   translateX(6px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(6px) rotate(-360deg); }
}

.momDotsWrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 4px;
}

.momDot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: momDotOrbit 1.2s linear infinite;
}

.momDot:nth-child(1) { animation-delay:  0s;    opacity: 1;   }
.momDot:nth-child(2) { animation-delay: -0.4s;  opacity: 0.7; }
.momDot:nth-child(3) { animation-delay: -0.8s;  opacity: 0.4; }

/* ===== ANIMAÇÃO: book ===== */
@keyframes momFlip {
    0%    { transform: rotateY(0deg);    background: transparent; }
    12%   { transform: rotateY(0deg);    background: rgba(128,128,128,0.10); }
    42%   { transform: rotateY(-90deg);  background: rgba(128,128,128,0.35); }
    72%   { transform: rotateY(-180deg); background: rgba(128,128,128,0.55); }
    84%   { transform: rotateY(-180deg); background: transparent; }
    84.1% { transform: rotateY(0deg);    background: transparent; }
    100%  { transform: rotateY(0deg);    background: transparent; }
}

.momBookWrap {
    display: inline-flex;
    align-items: center;
    perspective: 180px;
    perspective-origin: 50% 0%;
    margin-right: 4px;
    flex-shrink: 0;
}

.momBook {
    display: inline-flex;
    align-items: center;
    position: relative;
    gap: 0;
    transform: rotateX(28deg);
    transform-style: preserve-3d;
}

.momBookLeft {
    width: 11px;
    height: 16px;
    background: transparent;
    border-radius: 2px 0 0 2px;
    transform: rotateY(22deg);
    transform-origin: right center;
    border: 1.5px solid currentColor;
    border-right: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0.7;
}
.momBookLeft::before, .momBookLeft::after {
    content: ''; position: absolute; left: 2px; right: 2px;
    height: 1px; background: currentColor; border-radius: 1px; opacity: 0.5;
}
.momBookLeft::before { top: 4px; }
.momBookLeft::after  { top: 8px; }

.momBookSpine {
    width: 2px;
    height: 16px;
    background: currentColor;
    border-radius: 1px;
    flex-shrink: 0;
    z-index: 5;
}

.momBookRight {
    width: 11px;
    height: 16px;
    background: transparent;
    border-radius: 0 2px 2px 0;
    transform: rotateY(-22deg);
    transform-origin: left center;
    border: 1.5px solid currentColor;
    border-left: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0.7;
}
.momBookRight::before, .momBookRight::after {
    content: ''; position: absolute; left: 2px; right: 2px;
    height: 1px; background: currentColor; border-radius: 1px; opacity: 0.5;
}
.momBookRight::before { top: 4px; }
.momBookRight::after  { top: 8px; }

.momBookPage {
    position: absolute;
    top: 0;
    left: 13px;
    width: 11px;
    height: 16px;
    border-radius: 0 2px 2px 0;
    transform-origin: left center;
    z-index: 4;
    animation: momFlip 3.3s ease-in-out infinite;
}

.momBookPage:nth-child(1) { animation-delay: 0s;   }
.momBookPage:nth-child(2) { animation-delay: 1.1s; }
.momBookPage:nth-child(3) { animation-delay: 2.2s; }

/* ===== ANIMAÇÃO: spinner ===== */
@keyframes momSpinRing {
    to { transform: rotate(360deg); }
}

.momSpinnerWrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 4px;
}

.momSpinnerRing {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    animation: momSpinRing 0.7s linear infinite;
    opacity: 0.9;
}

/* ===== ANIMAÇÃO: bar ===== */
@keyframes momBarSlide {
    0%   { left: -40%; width: 40%; }
    50%  { left: 60%;  width: 40%; }
    100% { left: 110%; width: 10%; }
}

.momBarWrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 4px;
}

.momBarTrack {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.momBarTrack::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.2;
    border-radius: 2px;
}

.momBarFill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 2px;
    background: currentColor;
    animation: momBarSlide 1.4s ease-in-out infinite;
}

/* ===== ANIMAÇÃO: hourglass ===== */
@keyframes momHourglassSpin {
    0%,  40%  { transform: rotate(0deg);   }
    50%, 90%  { transform: rotate(180deg); }
    100%      { transform: rotate(180deg); }
}

@keyframes momSandTop {
    0%,  10%  { transform: scaleY(1);   transform-origin: bottom; }
    40%       { transform: scaleY(0);   transform-origin: bottom; }
    50%, 100% { transform: scaleY(0);   transform-origin: bottom; }
}

@keyframes momSandBot {
    0%,  10%  { transform: scaleY(0);   transform-origin: top; }
    40%       { transform: scaleY(0);   transform-origin: top; }
    50%       { transform: scaleY(0);   transform-origin: top; }
    90%       { transform: scaleY(1);   transform-origin: top; }
    100%      { transform: scaleY(1);   transform-origin: top; }
}

.momHourglassWrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 4px;
}

.momHourglass {
    position: relative;
    width: 14px;
    height: 18px;
    animation: momHourglassSpin 2s ease-in-out infinite;
}

.momHourglass::before,
.momHourglass::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
}

.momHourglass::before {
    top: 0;
    border-top: 8px solid currentColor;
    opacity: 0.85;
}

.momHourglass::after {
    bottom: 0;
    border-bottom: 8px solid currentColor;
    opacity: 0.85;
}

.momHourglassSandTop,
.momHourglassSandBot {
    position: absolute;
    left: 2px; right: 2px;
    background: currentColor;
    opacity: 0.5;
}

.momHourglassSandTop {
    top: 1px;
    height: 6px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    animation: momSandTop 2s ease-in-out infinite;
}

.momHourglassSandBot {
    bottom: 1px;
    height: 6px;
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
    animation: momSandBot 2s ease-in-out infinite;
}
