:root {
    --qo-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --qo-color-primary: #7c3aed;
    --qo-color-primary-hover: #6d28d9;
    --qo-color-primary-active: #5b21b6;
    --qo-color-primary-light: #f5f3ff;
    --qo-color-primary-border: #ddd6fe;
    --qo-color-error: #dc2626;
    --qo-color-error-light: #fef2f2;
    --qo-color-error-border: #fecaca;
    --qo-color-success: #059669;
    --qo-color-success-light: #ecfdf5;
    --qo-color-success-border: #a7f3d0;
    --qo-color-text: #0f172a;
    --qo-color-muted: #94a3b8;
    --qo-color-text-secondary: #475569;
    --qo-color-text-muted: #94a3b8;
    --qo-color-border: #e2e8f0;
    --qo-color-border-hover: #cbd5e1;
    --qo-color-bg: #ffffff;
    --qo-color-bg-secondary: #f8fafc;
    --qo-color-bg-tertiary: #f1f5f9;
    --qo-color-warning: #d97706;
    --qo-color-warning-hover: #b45309;
    --qo-color-warning-light: #fffbeb;
    --qo-color-warning-border: #fde68a;
    --qo-color-on-primary: #ffffff;
    --qo-shadow-primary: 0 1px 3px rgba(124, 58, 237, 0.3);
    --qo-shadow-primary-hover: 0 4px 12px rgba(124, 58, 237, 0.35), 0 4px 6px rgba(15, 23, 42, 0.07);
    --qo-shadow-primary-lg: 0 4px 14px rgba(124, 58, 237, 0.35);
    --qo-shadow-primary-xl: 0 6px 20px rgba(124, 58, 237, 0.4);
    --qo-radius: 8px;
    --qo-radius-lg: 12px;
    --qo-radius-xl: 16px;
    --qo-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --qo-shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.15), 0 8px 20px rgba(15, 23, 42, 0.06);
    --qo-duration-fast: 120ms;
    --qo-duration-normal: 200ms;
    --qo-duration-slow: 350ms;
    --qo-duration-slower: 500ms;
    --qo-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --qo-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --qo-text-xs: 0.6875rem;
    --qo-text-sm: 0.8125rem;
    --qo-text-base: 0.9375rem;
    --qo-text-lg: 1.125rem;
    --qo-text-xl: 1.375rem;
    --s1: 0.25rem;
    --s2: 0.5rem;
    --s3: 0.75rem;
    --s4: 1rem;
    --s5: 1.25rem;
    --s6: 1.5rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.qo-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    padding: 16px;
    transition: opacity var(--qo-duration-slow) var(--qo-ease-out), backdrop-filter var(--qo-duration-slow) var(--qo-ease-out);
}

.qo-modal-overlay.qo--open {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qo-modal {
    background: var(--qo-color-bg);
    border-radius: var(--qo-radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--qo-shadow-xl);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity var(--qo-duration-slow) var(--qo-ease-out), transform var(--qo-duration-slow) var(--qo-ease-out);
}

.qo-modal-overlay.qo--open .qo-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.qo-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--qo-color-border);
    flex-shrink: 0;
    min-height: 60px;
}

.qo-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--qo-color-text);
}

.qo-modal__close {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: var(--qo-color-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--qo-duration-fast) var(--qo-ease-out), color var(--qo-duration-fast) var(--qo-ease-out);
}

.qo-modal__close:hover {
    background: var(--qo-color-bg-secondary);
    color: var(--qo-color-text);
}

.qo-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    -webkit-overflow-scrolling: touch;
}

.qo-modal__body::-webkit-scrollbar {
    width: 4px;
}

.qo-modal__body::-webkit-scrollbar-thumb {
    background: var(--qo-color-border);
    border-radius: 999px;
}

.qo-modal__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
}

.qo-modal__brand-logo {
    max-width: 100%;
}

.qo-modal__brand-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: var(--qo-brand-logo-max-height, 32px);
    object-fit: contain;
}

.qo-modal__brand-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.qo-modal__brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    color: var(--qo-color-text-secondary);
    line-height: 1;
    white-space: nowrap;
}

.qo-modal__brand-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
}

.qo-modal__brand-badge-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke: var(--qo-color-primary);
    fill: none;
    stroke-width: 2.5;
}

.qo-modal__brand-badge-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qo-modal__brand-badge-text {
    display: block;
}

.qo-modal__section + .qo-modal__section {
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid var(--qo-color-border);
}

.qo-modal__footer {
    padding: 16px 0px 24px;
    border-top: 1px solid var(--qo-color-border);
    background: var(--qo-color-bg);
}

.qo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--qo-color-primary);
    color: var(--qo-color-on-primary);
    border: none;
    border-radius: var(--qo-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: var(--qo-shadow-primary), var(--qo-shadow-sm);
    transition: background var(--qo-duration-normal) var(--qo-ease-out), box-shadow var(--qo-duration-normal) var(--qo-ease-out), transform var(--qo-duration-fast) var(--qo-ease-out);
}

.qo-btn:hover {
    background: var(--qo-color-primary-hover);
    color: var(--qo-color-on-primary);
    box-shadow: var(--qo-shadow-primary-hover);
    transform: translateY(-1px);
}

.qo-btn:active {
    background: var(--qo-color-primary-active);
    transform: translateY(0);
}

.qo-modal,
.qo-modal button,
.qo-modal input,
.qo-modal textarea,
.qo-modal select,
.qo-btn {
    font-family: var(--qo-font-sans);
}

.qo-loading,
.qo-error,
.qo-placeholder {
    text-align: center;
    color: var(--qo-color-muted);
    padding: 40px 0;
    font-size: 0.9375rem;
}

.qo-loading--shimmer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px 16px;
}

.qo-shimmer {
    background: linear-gradient(90deg, var(--qo-color-bg-tertiary) 25%, var(--qo-color-bg-secondary) 50%, var(--qo-color-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--qo-radius);
}

.qo-shimmer--text {
    height: 14px;
    width: 60%;
    border-radius: 4px;
}

.qo-shimmer--text-sm {
    height: 10px;
    width: 40%;
    border-radius: 4px;
}

.qo-shimmer--image {
    width: 44px;
    height: 44px;
    border-radius: var(--qo-radius);
}

.qo-shimmer--button {
    height: 48px;
    width: 100%;
    border-radius: var(--qo-radius);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.qo-error {
    color: var(--qo-color-error);
}

@media (max-width: 640px) {
    .qo-modal-overlay {
        align-items: center;
        padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }

    .qo-modal {
        width: 100%;
        max-width: 560px;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        border-radius: var(--qo-radius-xl);
        transform: translateY(20px) scale(0.97);
    }

    .qo-modal-overlay.qo--open .qo-modal {
        transform: translateY(0) scale(1);
    }

    .qo-modal-overlay.qo-modal-overlay--position-bottom {
        align-items: flex-end;
        padding: 0;
    }

    .qo-modal-overlay.qo-modal-overlay--position-bottom .qo-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--qo-radius-xl) var(--qo-radius-xl) 0 0;
        transform: translateY(100%);
    }

    .qo-modal-overlay.qo-modal-overlay--position-bottom.qo--open .qo-modal {
        transform: translateY(0);
    }

    .qo-modal-overlay.qo-modal-overlay--position-center .qo-pause {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .qo-modal__header {
        padding: 16px;
        min-height: 52px;
    }

    .qo-modal__body {
        padding: 16px;
    }

    .qo-modal__footer {
        padding: 12px 0px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qo-modal-overlay,
    .qo-modal,
    .qo-btn,
    .qo-modal__close {
        transition-duration: 0.01ms !important;
    }
}

/* ═══ SUCCESS ═══ */
.qo-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 16px;
    gap: 16px;
}

.qo-success__check {
    width: 72px;
    height: 72px;
    border-radius: var(--qo-radius-full, 9999px);
    background: var(--qo-color-success-light);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkScale var(--qo-duration-slower) var(--qo-ease-spring);
}

.qo-success__check svg {
    width: 36px;
    height: 36px;
    stroke: var(--qo-color-success);
    stroke-width: 3;
    fill: none;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkDraw .5s var(--qo-ease-out) .2s forwards;
}

.qo-success__title {
    font-size: var(--qo-text-xl);
    font-weight: 700;
    color: var(--qo-color-text);
}

.qo-success__order {
    font-size: var(--qo-text-base);
    color: var(--qo-color-text-secondary);
    margin:0;
}

.qo-success p {
    margin: 0;
}

.qo-success__order strong {
    color: var(--qo-color-text);
}

.qo-success__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
    margin-top: 8px;
}

@keyframes checkScale {
    0% { transform: scale(0); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

/* ═══ PAUSE / RECOVERY ═══ */
.qo-pause {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px 16px;
    gap: 12px;
    animation: fadeUp var(--qo-duration-normal) var(--qo-ease-out);
}

.qo-pause--on {
    display: flex;
}

.qo-pause__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--qo-radius-full, 9999px);
    background: var(--qo-color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--qo-color-primary);
    flex-shrink: 0;
}

.qo-pause__icon svg {
    width: 22px;
    height: 22px;
}

.qo-pause__title {
    font-size: var(--qo-text-base);
    font-weight: 700;
    color: var(--qo-color-text);
}

.qo-pause__offer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1;
}

.qo-pause__offer-pct {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--qo-color-success);
    letter-spacing: -0.02em;
}

.qo-pause__offer-lbl {
    font-size: var(--qo-text-xs);
    font-weight: 700;
    color: var(--qo-color-success);
    letter-spacing: 0.12em;
}

.qo-pause__desc {
    font-size: var(--qo-text-sm);
    color: var(--qo-color-text-secondary);
    max-width: 300px;
    line-height: 1.5;
}

.qo-pause__btn {
    width: 100%;
    max-width: 320px;
    padding: var(--s3) var(--s6);
    background: var(--qo-color-primary);
    color: var(--qo-color-on-primary);
    border: none;
    border-radius: var(--qo-radius-lg);
    font-size: var(--qo-text-base);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--qo-duration-normal) var(--qo-ease-out);
    box-shadow: var(--qo-shadow-primary-lg);
}

.qo-pause__btn:hover {
    background: var(--qo-color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--qo-shadow-primary-xl);
}

.qo-pause__btn:active {
    transform: translateY(0);
}

.qo-pause__exit {
    font-size: var(--qo-text-sm);
    color: var(--qo-color-text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: var(--s2);
    transition: color var(--qo-duration-fast) var(--qo-ease-out);
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.qo-pause__exit:hover {
    color: var(--qo-color-text-secondary);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══ FOOTER ═══ */
.qo-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qo-foot__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: var(--s3) var(--s6);
    background: var(--qo-color-primary);
    color: var(--qo-color-on-primary);
    border: none;
    border-radius: var(--qo-radius-lg);
    font-size: var(--qo-text-lg);
    font-weight: 700;
    transition: all var(--qo-duration-normal) var(--qo-ease-out);
    box-shadow: var(--qo-shadow-primary-lg);
    line-height: 1.2;
    width: 100%;
    cursor: pointer;
}

.qo-foot__btn:hover {
    background: var(--qo-color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--qo-shadow-primary-xl);
}

.qo-foot__btn:active {
    transform: translateY(0);
}

.qo-foot__btn:disabled {
    background: var(--qo-color-text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.qo-foot__btn--online {
    background: transparent;
    color: var(--qo-color-primary);
    border: 2px solid var(--qo-color-primary);
    box-shadow: none;
    text-decoration: none;
}

.qo-foot__btn--online:hover {
    background: var(--qo-color-primary-light);
    box-shadow: none;
    transform: none;
}

.qo-deco-image {
    margin: 8px 0;
    text-align: center;
}

.qo-deco-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--qo-radius);
}

.qo-foot__btn-label {
    font-size: var(--qo-text-base);
    font-weight: 700;
}

.qo-foot__btn-price {
    font-size: var(--qo-text-lg);
    font-weight: 800;
}

.qo-foot__btn-sub {
    font-size: var(--qo-text-xs);
    font-weight: 400;
    opacity: 0.85;
}

.qo-foot__guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: var(--qo-text-xs);
    color: var(--qo-color-text-muted);
    line-height: 1.4;
}

.qo-foot__guarantee .qo-form__icon {
    position: static;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--qo-color-text-muted);
    transform: none;
    pointer-events: none;
    transition: none;
}


