.app-checkout-form,
.sqrl-checkout-form {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.app-checkout-button,
.sqrl-checkout-button {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    min-height: 44px;
}

.app-checkout-button:disabled,
.sqrl-checkout-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.app-checkout-spinner,
.sqrl-button-spinner {
    animation: app-checkout-spin 0.8s linear infinite;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    display: inline-block;
    height: 16px;
    width: 16px;
    visibility: hidden;
}

.app-checkout-button.is-loading .app-checkout-spinner,
.sqrl-checkout-button.is-loading .sqrl-button-spinner {
    visibility: visible;
}

.app-checkout-status,
.sqrl-checkout-status {
    color: #b32d2e;
    font-size: 13px;
    line-height: 1.4;
}

@keyframes app-checkout-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-checkout-spinner,
    .sqrl-button-spinner {
        animation-duration: 1.6s;
    }
}

body.app-contact-open {
    overflow: hidden;
}

.app-contact-overlay[hidden] {
    display: none;
}

.app-contact-overlay {
    align-items: center;
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 2147483000;
}

.app-contact-dialog,
.app-contact-dialog * {
    box-sizing: border-box;
}

.app-contact-dialog {
    animation: app-contact-enter .18s ease-out both;
    background: #fff !important;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .2), 0 1px 3px rgba(0, 0, 0, .05);
    color: #0f172a;
    font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    max-width: 480px;
    overscroll-behavior: contain;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    scroll-padding-bottom: 24px;
    width: 100%;
}

@keyframes app-contact-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-contact-header {
    margin: 0 48px 20px 0;
}

.app-contact-badge {
    align-items: center;
    color: #475569;
    display: inline-flex;
    font: 700 11px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    gap: 8px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app-contact-status-dot {
    animation: app-contact-pulse 1.8s ease-in-out infinite;
    background: #059669;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
    height: 7px;
    width: 7px;
}

@keyframes app-contact-pulse {
    50% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
}

.app-contact-dialog .app-contact-header h2 {
    color: #0f172a;
    font: 700 24px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    margin: 15px 0 8px;
}

.app-contact-intro {
    color: #475569;
    font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    margin: 0;
}

.app-contact-summary {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 0 20px;
    min-height: 54px;
    padding: 10px 12px;
}

.app-contact-plan {
    color: #334155;
    font: 600 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-contact-price {
    background: #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    flex-shrink: 0;
    font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: 6px 9px;
    white-space: nowrap;
}

.app-contact-dialog .app-contact-close {
    align-items: center;
    appearance: none;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 50%;
    box-shadow: none !important;
    color: #64748b !important;
    cursor: pointer;
    display: flex;
    height: 44px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 20px;
    top: 20px;
    width: 44px;
}

.app-contact-dialog .app-contact-close:hover {
    color: #0f172a !important;
}

.app-contact-close svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
    width: 20px;
}

.app-contact-form {
    display: grid;
    gap: 16px;
}

.app-contact-name-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-contact-dialog .app-contact-form label {
    color: #334155;
    display: grid;
    font: 600 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    gap: 7px;
    letter-spacing: 0;
    margin: 0;
    min-width: 0;
}

.app-contact-input {
    display: block;
    position: relative;
}

.app-contact-input svg {
    fill: none;
    height: 17px;
    left: 14px;
    pointer-events: none;
    position: absolute;
    stroke: #94a3b8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
}

.app-contact-dialog .app-contact-form input {
    appearance: none;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 7px;
    box-shadow: none !important;
    color: #0f172a !important;
    font: 400 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    min-height: 48px;
    padding: 12px 14px 12px 40px;
    text-transform: none;
    width: 100%;
}

.app-contact-dialog .app-contact-form textarea {
    appearance: none;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 7px;
    color: #0f172a !important;
    font: 400 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 96px;
    padding: 12px 14px 12px 40px;
    resize: vertical;
    width: 100%;
}

.app-contact-textarea svg { top: 22px; }
.app-contact-dialog .app-country-field { display: grid; gap: 7px; min-width: 0; }
.app-contact-dialog .sqrl-country-picker { display: block; min-width: 0; position: relative; }
.app-contact-dialog .sqrl-country-picker select,
.app-contact-dialog .sqrl-country-trigger {
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 7px;
    color: #0f172a !important;
    font: 400 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 48px;
    padding: 11px 14px;
    width: 100%;
}
.app-contact-dialog .sqrl-country-picker.is-enhanced select {
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}
.app-contact-dialog .sqrl-country-trigger {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    text-align: left;
}
.app-contact-dialog .sqrl-country-value { align-items: center; display: flex; gap: 10px; min-width: 0; }
.app-contact-dialog .sqrl-country-flag { align-items: center; display: inline-flex; flex: none; height: 16px; justify-content: center; width: 23px; }
.app-contact-dialog .sqrl-country-flag[hidden] { display: none !important; }
.app-contact-dialog .sqrl-country-flag img { display: block !important; height: 16px !important; object-fit: cover; width: 23px !important; }
.app-contact-dialog .sqrl-country-flag img[hidden],
.app-contact-dialog .sqrl-country-flag-fallback[hidden] { display: none !important; }
.app-contact-dialog .sqrl-country-flag-fallback { background: #e2e8f0; border-radius: 2px; color: #475569; font: 700 9px/16px sans-serif; height: 16px; text-align: center; width: 23px; }
.app-contact-dialog .sqrl-country-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-contact-dialog .sqrl-country-chevron { border-bottom: 2px solid #64748b; border-right: 2px solid #64748b; flex: none; height: 8px; transform: rotate(45deg); width: 8px; }
.app-contact-dialog .sqrl-country-panel { background: #fff; border: 1px solid #cbd5e1; border-radius: 7px; box-shadow: 0 10px 24px rgba(15,23,42,.12); margin-top: 6px; padding: 8px; }
.app-contact-dialog .sqrl-country-panel[hidden] { display: none !important; }
.app-contact-dialog .sqrl-country-search { padding-left: 12px !important; }
.app-contact-dialog .sqrl-country-list { max-height: 216px; overflow-y: auto; padding-top: 5px; }
.app-contact-dialog .sqrl-country-option { align-items: center; background: #fff !important; border: 0 !important; border-radius: 5px; color: #0f172a !important; cursor: pointer; display: flex; font: 400 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; gap: 10px; min-height: 40px; padding: 9px 10px; text-align: left; width: 100%; }
.app-contact-dialog .sqrl-country-option[hidden] { display: none !important; }
.app-contact-dialog .sqrl-country-option:hover,
.app-contact-dialog .sqrl-country-option[aria-selected="true"] { background: #eef5f3 !important; }
.app-contact-dialog .sqrl-country-option:focus-visible,
.app-contact-dialog .sqrl-country-trigger:focus-visible { outline: 2px solid #0f172a !important; outline-offset: 1px; }
.app-contact-dialog .app-contact-form textarea::placeholder { color: #94a3b8; opacity: 1; }
.app-contact-dialog .app-contact-form textarea:focus { border-color: #0f172a !important; box-shadow: 0 0 0 3px rgba(15, 23, 42, .08) !important; outline: none !important; }

.app-contact-dialog .app-contact-form input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.app-contact-dialog .app-contact-form input:focus,
.app-contact-dialog button:focus-visible {
    outline: 2px solid #0f172a !important;
    outline-offset: 1px;
}

.app-contact-dialog .app-contact-form input:focus {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, .08) !important;
    outline: none !important;
}

.app-contact-form .app-checkout-status {
    color: #b42318;
    margin: 0;
    min-height: 0;
}

.app-contact-form .app-checkout-status:empty {
    display: none;
}

.app-coupon-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 7px;
}

.app-contact-dialog .app-coupon-controls input {
    padding-left: 14px;
}

.app-contact-dialog .app-coupon-apply {
    background: #e8eef1;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #0f172a;
    cursor: pointer;
    font: 650 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 48px;
    padding: 0 18px;
}

.app-contact-dialog .app-coupon-apply:hover:not(:disabled) {
    background: #dce7e9;
}

.app-coupon-feedback {
    color: #475569;
    font-size: 12px;
    margin: 6px 0 0;
}

.app-coupon-feedback:empty { display: none; }
.app-coupon-totals { border-top: 1px solid #e2e8f0; color: #475569; display: grid; gap: 6px; padding-top: 12px; }
.app-coupon-totals[hidden] { display: none !important; }
.app-coupon-totals > div { display: flex; gap: 12px; justify-content: space-between; }
.app-coupon-totals > div:last-child { color: #0f172a; font-weight: 700; }

.app-contact-dialog .app-contact-continue {
    align-items: center;
    appearance: none;
    background: #0f172a !important;
    background-image: none !important;
    border: 1px solid #0f172a !important;
    border-radius: 7px;
    box-shadow: none !important;
    color: #fff !important;
    cursor: pointer;
    display: flex;
    font: 700 15px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    gap: 8px;
    justify-content: center;
    letter-spacing: 0;
    min-height: 52px;
    padding: 13px 16px;
    text-align: center;
    text-transform: none;
    transition: background-color .16s ease, border-color .16s ease;
    width: 100%;
}

.app-contact-dialog .app-contact-continue:hover:not(:disabled) {
    background: #1e293b !important;
    border-color: #1e293b !important;
}

.app-contact-dialog .app-contact-continue:disabled {
    cursor: wait;
    opacity: .86;
}

.app-contact-arrow {
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
}

.app-contact-spinner {
    animation: app-checkout-spin .8s linear infinite;
    border: 2px solid rgba(255, 255, 255, .4);
    border-radius: 50%;
    border-top-color: #fff;
    display: none;
    height: 16px;
    width: 16px;
}

.app-contact-continue.is-loading .app-contact-spinner {
    display: inline-block;
}

.app-contact-payments {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: center;
}

.app-contact-payments span {
    aspect-ratio: 3 / 2;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    flex: 1 1 0;
    max-width: 60px;
    min-width: 0;
}

.app-contact-payments svg {
    display: block;
    height: 100%;
    width: 100%;
}

.app-contact-trust {
    color: #64748b;
    font: 500 11px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    margin: -4px 0 0;
    text-align: center;
}

@media (min-width: 768px) {
    .app-contact-overlay {
        padding: 12px;
    }

    .app-contact-dialog {
        height: auto;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        max-width: 540px;
        padding: 28px 32px;
    }

    .app-contact-header {
        margin-bottom: 16px;
    }

    .app-contact-dialog .app-contact-header h2 {
        margin: 12px 0 7px;
    }

    .app-contact-summary {
        margin-bottom: 16px;
        min-height: 54px;
        padding: 10px 12px;
    }

    .app-contact-form {
        gap: 14px;
    }

    .app-contact-dialog .app-contact-form label,
    .app-contact-dialog .app-country-field {
        gap: 7px;
    }

    .app-contact-dialog .app-contact-form input,
    .app-contact-dialog .sqrl-country-picker select,
    .app-contact-dialog .sqrl-country-trigger,
    .app-contact-dialog .app-coupon-apply {
        min-height: 48px;
    }

    .app-contact-dialog .app-contact-form input {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .app-coupon-controls {
        margin-top: 7px;
    }

    .app-coupon-feedback {
        margin-top: 6px;
    }

    .app-contact-dialog .app-contact-continue {
        min-height: 52px;
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .app-contact-payments span {
        max-width: 60px;
    }

    .app-contact-trust {
        margin-top: -4px;
    }
}

@media (min-width: 768px) and (max-height: 800px) {
    .app-contact-dialog {
        padding: 20px 28px;
    }

    .app-contact-header {
        margin-bottom: 10px;
    }

    .app-contact-dialog .app-contact-header h2 {
        margin: 8px 0 5px;
    }

    .app-contact-summary {
        margin-bottom: 10px;
        min-height: 48px;
    }

    .app-contact-form {
        gap: 8px;
    }

    .app-contact-dialog .app-contact-form label,
    .app-contact-dialog .app-country-field {
        gap: 5px;
    }

    .app-coupon-controls {
        margin-top: 5px;
    }

    .app-coupon-feedback {
        margin-top: 3px;
    }

    .app-contact-dialog .app-contact-continue {
        min-height: 48px;
        padding-top: 11px;
        padding-bottom: 11px;
    }
}

@media (max-width: 480px) {
    .app-contact-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .app-contact-dialog {
        border-radius: 16px 16px 0 0;
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
        padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    }

    .app-contact-name-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-contact-summary {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-contact-status-dot {
        animation: none;
    }
    .app-contact-dialog {
        animation: none;
    }

    .app-contact-continue {
        transition: none;
    }

    .app-contact-spinner {
        animation-duration: 1.6s;
    }
}
