:root {
    --sidebar-bg: #000000;
    --sidebar-text: #ffffff;
    --checkout-bg: #ffffff;
    --checkout-text: #1d1d1f;
    --border-color: #e5e5e5;
    /* Обновленные акцентные цвета под ярко-зеленый */
    --accent-color: #4fea60;
    --accent-hover: #4fea60; 
    --accent-disabled: #a8f0b3; /* Светло-зеленый для неактивного состояния */
    --amazon-yellow: #ffd814;
    --link-color: #0c66ff;
    --badge-green: #1a8917;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--checkout-bg);
    color: var(--checkout-text);
    overflow-x: hidden;
}

/* =========================================================================
   STATE MANAGEMENT
   ========================================================================= */
[data-state="hidden"] {
    display: none !important;
}

/* =========================================================================
   LAYOUT
   ========================================================================= */
.qx-split-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================================================================
   SIDEBAR (Brand Column)
   ========================================================================= */
.qx-brand-column {
    flex: 0 0 50%;
    background-color: #4fea60;
    color: #1a1f36;
    display: flex;
    justify-content: flex-end;
    padding: 60px 80px;
}

.qx-brand-inner {
    width: 100%;
    max-width: 380px;
}

.qx-brand-header {
    margin-bottom: 48px;
}

.qx-brand-header h2 {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: #1a1f36;
    opacity: 0.8;
}

.qx-summary-title {
    font-size: 16px;
    font-weight: 500;
    color: #1a1f36;
    margin-bottom: 24px;
}

.qx-price-tag {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.qx-price-val {
    font-size: 48px;
    font-weight: 700;
    color:#1a1f36;
}

.qx-product-desc {
    font-size: 16px;
    color: #1a1f36;
}

/* =========================================================================
   CHECKOUT COLUMN
   ========================================================================= */
.qx-checkout-column {
    flex: 0 0 50%;
    background-color: var(--checkout-bg);
    padding: 60px 80px;
    display: flex;
    justify-content: flex-start;
}

.qx-checkout-inner {
    width: 100%;
    max-width: 380px;
}

.qx-form-wrapper {
    width: 100%;
}

/* =========================================================================
   FORM BLOCKS & INPUTS
   ========================================================================= */
.qx-form-block {
    margin-bottom: 32px;
    border: none;
    padding: 0;
}

.qx-block-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: block;
}

.qx-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    padding: 2px 16px;
    background-color: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.qx-input-wrap:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.qx-input-label {
    font-size: 14px;
    color: #4f566b;
    width: 60px;
    display: flex;
    align-items: center;
    height: 48px;
}

.qx-text-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 15px;
    color: #1a1f36;
    outline: none;
    width: 100%;
}

.qx-error-msg {
    color: #df1b41;
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
    display: block;
}

/* =========================================================================
   PAYMENT METHODS
   ========================================================================= */
.qx-pay-options {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.qx-pay-option {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.2s;
}

.qx-pay-option:last-child {
    border-bottom: none;
}

.qx-pay-option.qx-is-active {
    background-color: #fff;
    z-index: 1;
}

.qx-option-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.qx-option-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qx-opt-icon {
    width: 20px;
    height: 14px;
    object-fit: contain;
}

.qx-opt-name {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
}

.qx-option-right {
    display: flex;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.qx-pay-option.qx-is-active .qx-option-right {
    opacity: 0;
    pointer-events: none;
}

.qx-brand-sm {
    height: 16px;
    width: auto;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    padding: 1px 3px;
}

/* =========================================================================
   CARD FORM EXPANSION
   ========================================================================= */
.qx-card-fields {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.3s ease;
    overflow: hidden;
}

.qx-pay-option.qx-is-active .qx-card-fields {
    grid-template-rows: 1fr;
    margin-top: 16px;
}

.qx-field {
    margin-bottom: 12px;
}

.qx-field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #424770;
    margin-bottom: 4px;
    margin-top: 12px;
}

.qx-input-row {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 3px 6px rgba(0, 0, 0, 0.02);
}

.qx-field-num {
    position: relative;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.qx-field-num .qx-text-input {
    padding: 12px;
}

.qx-card-brands {
    position: absolute;
    right: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: none;
}

.qx-brand-md {
    height: 20px;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
}

.qx-brand-div {
    width: 1px;
    height: 16px;
    background-color: #e5e5e5;
}

.qx-field-exp-cvv {
    display: flex;
}

#qx-field-exp {
    width: 50%;
    padding: 12px 14px;
    border: none;
    border-right: 1px solid var(--border-color);
    outline: none;
    font-size: 14px;
    background: transparent;
}

.qx-field-cvv {
    position: relative;
    width: 50%;
    display: flex;
    align-items: center;
}

#qx-field-cvv {
    width: 100%;
    padding: 12px 14px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.qx-cvv-svg {
    position: absolute;
    right: 12px;
    width: 24px;
    height: 16px;
    pointer-events: none;
}

/* =========================================================================
   SELECTS & ADDITIONAL INPUTS
   ========================================================================= */
.qx-select-wrap {
    position: relative;
}

#qx-field-country,
#qx-field-card-name {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

#qx-field-country:focus,
#qx-field-card-name:focus,
.qx-input-row:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

#qx-field-country {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* =========================================================================
   BUTTONS & FOOTER (ОБНОВЛЕНО: Ярко-зеленый #4fea60)
   ========================================================================= */
.qx-submit-btn,
.qx-confirm-btn,
.qx-done-btn {
    width: 100%;
    padding: 16px;
    background-color: #4fea60; /* Яркий зеленый по запросу */
    color: #1a1f36; /* Темный текст для идеального контраста на ярком фоне */
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 24px;
    transition: background-color 0.15s, transform 0.1s, opacity 0.15s;
}

/* Ховер: тот же цвет, но с легким изменением прозрачности для тактильного отклика */
.qx-submit-btn:hover:not(:disabled),
.qx-confirm-btn:hover:not(:disabled),
.qx-done-btn:hover:not(:disabled) {
    background-color: #4fea60;
    opacity: 0.85;
}

.qx-submit-btn:active:not(:disabled),
.qx-confirm-btn:active:not(:disabled) {
    background-color: #4fea60;
    transform: scale(0.98);
    opacity: 0.75;
}

.qx-submit-btn:disabled,
.qx-confirm-btn:disabled {
    background-color: var(--accent-disabled);
    color: #ffffff;
    opacity: 1;
    cursor: not-allowed;
}

/* Вторичная кнопка (оставлена нейтральной для сохранения иерархии) */
.qx-confirm-btn.qx-btn-alt {
    background-color: #f7f8fa;
    color: #3c4257;
    border: 1px solid #e3e8ee;
    margin-bottom: 16px;
}

.qx-confirm-btn.qx-btn-alt:hover {
    background-color: #edeff2;
    opacity: 1;
}

.qx-terms-text {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 32px;
    text-align: center;
}

.qx-form-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    color: #a1a1a1;
    flex-wrap: wrap;
}

.qx-footer-nav {
    display: flex;
    gap: 12px;
}

.qx-footer-nav a {
    color: inherit;
    text-decoration: none;
}

.qx-footer-nav a:hover {
    text-decoration: underline;
}

/* =========================================================================
   RADIO BUTTONS
   ========================================================================= */
input[type="radio"] {
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    cursor: pointer;
    position: relative;
}

input[type="radio"]:checked {
    border-color: var(--accent-color);
    background-color: #fff;
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

/* =========================================================================
   VERIFICATION FLOW SCREENS
   ========================================================================= */
.qx-view {
    animation: qxScreenFadeIn 0.4s ease-out;
}

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

.qx-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.qx-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: qxSpin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes qxSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qx-loader-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.qx-auth-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.qx-auth-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1f36;
}

.qx-auth-desc {
    font-size: 14px;
    color: #697386;
    margin-bottom: 32px;
    line-height: 1.5;
}

.qx-otp-wrap {
    width: 100%;
    margin-bottom: 32px;
}

.qx-otp-input {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 8px;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qx-otp-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
    outline: none;
}

.qx-otp-input.error {
    border-color: #df1b41;
}

.qx-resend-action {
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 40px;
    display: inline-block;
}

.qx-resend-action:hover {
    text-decoration: underline;
}

.qx-auth-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #697386;
    font-size: 12px;
}

.qx-secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qx-auth-footer::before {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23697386' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.qx-app-visual {
    margin-bottom: 24px;
    background-color: #f7f8fa;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qx-pulse-anim {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.qx-pulse-ring {
    width: 60px;
    height: 60px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    position: absolute;
    top: -45px;
    animation: qxPulse 2s infinite;
}

@keyframes qxPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { opacity: 0.2; }
    100% { transform: scale(1.5); opacity: 0; }
}

.qx-wait-msg {
    font-size: 14px;
    color: #697386;
    font-style: italic;
}

/* =========================================================================
   CRYPTO FLOW STYLES
   ========================================================================= */
.qx-text-center {
    text-align: center;
}

.qx-crypto-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0 32px;
}

.qx-crypto-opt {
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    text-align: center;
    font-family: inherit;
}

.qx-crypto-opt:hover {
    border-color: var(--accent-color);
    background: #f8fafc;
    transform: translateY(-2px);
}

.qx-crypto-opt.qx-is-active {
    border-color: var(--accent-color);
    background: #f0f7ff;
    box-shadow: 0 0 0 1px var(--accent-color);
}

.qx-coin-svg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.qx-coin-svg.btc { background-color: rgba(247, 147, 26, 0.1); }
.qx-coin-svg.usdt { background-color: rgba(38, 161, 123, 0.1); }

.qx-coin-svg svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qx-coin-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f36;
}

/* =========================================================================
   SUCCESS SCREEN (OVERLAY)
   ========================================================================= */
#qx-view-success {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #f6f9fc;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.qx-success-box {
    max-width: 400px;
    animation: qxFadeIn 0.8s ease-out;
}

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

.qx-success-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1f36;
    margin-bottom: 12px;
}

.qx-success-msg {
    font-size: 16px;
    color: #4f566b;
    line-height: 1.5;
    margin-bottom: 32px;
}

.qx-checkmark-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.qx-checkmark-svg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #22c55e;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #22c55e;
    animation: qxFill .4s ease-in-out .4s forwards, qxScale .3s ease-in-out .9s both;
}

.qx-check-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #22c55e;
    fill: none;
    animation: qxStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.qx-check-path {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: qxStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes qxStroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes qxScale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes qxFill {
    100% { box-shadow: inset 0px 0px 0px 40px #22c55e; stroke: #fff; }
}

/* =========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================= */
@media (max-width: 900px) {
    .qx-split-layout {
        flex-direction: column;
        height: auto;
        overflow-y: visible;
    }

    .qx-brand-column {
        width: 100%;
        min-height: auto;
        padding: 40px 20px;
        justify-content: center;
        position: relative;
    }

    .qx-checkout-column {
        width: 100%;
        padding: 40px 20px;
        background: #fff;
        justify-content: center;
    }

    .qx-checkout-inner {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .qx-pay-option {
        padding: 12px;
    }
    
    .qx-auth-title {
        font-size: 20px;
    }
    
    .qx-price-val {
        font-size: 32px;
        color:#1a1f36;
    }
}
