/* M-Pesa "confirm on your phone" overlay (block checkout). */
.sm-mpesa-waiting-overlay {
    --sm-mpesa-accent: #e60000;
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 19, 24, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-sizing: border-box;
    animation: sm-mpesa-fade 0.2s ease-out;
}

.sm-mpesa-waiting-overlay__card {
    width: 100%;
    max-width: 400px;
    padding: 28px 24px 24px;
    border-radius: 20px;
    background: #fff;
    color: #1d2127;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    animation: sm-mpesa-rise 0.25s ease-out;
}

.sm-mpesa-waiting-overlay__logo {
    display: block;
    height: 36px;
    width: auto;
    margin: 0 auto 14px;
}

.sm-mpesa-waiting-overlay__title {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.sm-mpesa-waiting-overlay__text {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
}

.sm-mpesa-waiting-overlay__hint {
    margin: 18px 0 0;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Countdown ring */
.sm-mpesa-ring {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 0 auto;
}

.sm-mpesa-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.sm-mpesa-ring__track,
.sm-mpesa-ring__bar {
    fill: none;
    stroke-width: 8;
}

.sm-mpesa-ring__track {
    stroke: #f1f2f4;
}

.sm-mpesa-ring__bar {
    stroke: var(--sm-mpesa-accent);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.sm-mpesa-ring.is-waiting svg {
    animation: sm-mpesa-spin 1.4s linear infinite;
}

.sm-mpesa-ring.is-waiting .sm-mpesa-ring__bar {
    stroke-dashoffset: 250 !important;
}

.sm-mpesa-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--sm-mpesa-accent);
}

.sm-mpesa-ring__label strong {
    color: #1d2127;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.sm-mpesa-ring__label span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Steps */
.sm-mpesa-steps {
    display: grid;
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.sm-mpesa-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f6f7f9;
    font-size: 0.92rem;
}

.sm-mpesa-steps__num {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sm-mpesa-accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Dark themes */
.has-dark-controls .sm-mpesa-waiting-overlay__card {
    background: #1e1f22;
    color: #f2f3f5;
}

.has-dark-controls .sm-mpesa-waiting-overlay__text,
.has-dark-controls .sm-mpesa-waiting-overlay__hint,
.has-dark-controls .sm-mpesa-ring__label span {
    color: #a3a8b0;
}

.has-dark-controls .sm-mpesa-ring__label strong {
    color: #f2f3f5;
}

.has-dark-controls .sm-mpesa-ring__track {
    stroke: #2c2e33;
}

.has-dark-controls .sm-mpesa-steps li {
    background: #26282c;
}

@keyframes sm-mpesa-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sm-mpesa-rise {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes sm-mpesa-spin {
    to { transform: rotate(270deg); }
}

@media (prefers-reduced-motion: reduce) {
    .sm-mpesa-waiting-overlay,
    .sm-mpesa-waiting-overlay__card,
    .sm-mpesa-ring.is-waiting svg {
        animation: none;
    }
}
