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

:root {
    --text: #30313d;
    --textMuted: #697386;
    --border: #e6e8eb;
    --headerBg: #ffffff;
    --formBg: #f6f9fc;
    --primary: #635bff;
    --primaryHover: #5851e6;
    --radiusField: 6px;
    --radiusBtn: 8px;
    --fontSans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--formBg);
    color: var(--text);
    font-family: var(--fontSans);
    -webkit-font-smoothing: antialiased;
}

.srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
}

.stripeCheckout {
    width: 100%;
    max-width: 400px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--headerBg);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.stripeHeader {
    background: var(--headerBg);
    padding: 16px 20px 20px;
    flex-shrink: 0;
}

.stripeToolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.backBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radiusField);
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.backBtn:hover {
    background: #f6f9fc;
}

.toolbarBrand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.brandMark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f2f5;
}

.brandMark svg {
    display: block;
}

.toolbarBrandName {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.langSelect {
    appearance: none;
    background: var(--headerBg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23697386' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--border);
    border-radius: var(--radiusField);
    padding: 8px 28px 8px 12px;
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 110px;
}

.langSelect:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.2);
    border-color: var(--primary);
}

.stripeSummary {
    text-align: center;
}

.summaryMerchant {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--textMuted);
}

.summaryAmount {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.15;
}

.stripeFormArea {
    flex: 1;
    background: var(--formBg);
    padding: 20px 16px 32px;
}

.paymentForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formBlock {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blockLabel,
.fieldLabel {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.blockLabel {
    display: block;
}

.cardInputShell {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radiusField);
    overflow: hidden;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.cardInputShell:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}

.cardInputRowPan {
    position: relative;
    display: flex;
    align-items: center;
}

.cardInputDivider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.cardInputRowSplit {
    display: flex;
    align-items: stretch;
    min-height: 48px;
}

.splitCell {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.splitCell:first-child {
    border-right: 1px solid var(--border);
}

.splitCellCvc .stripeInputBare {
    padding-right: 40px;
}

.stripeInput {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radiusField);
    background: #fff;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stripeInput::placeholder {
    color: #87929e;
}

.stripeInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}

.stripeInputBare {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: 48px;
}

.stripeInputBare:focus {
    box-shadow: none;
}

.cardInputShell:focus-within .stripeInputBare:focus {
    box-shadow: none;
}

.singleField {
    position: relative;
}

.singleField .stripeInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}

.countrySelect {
    width: 100%;
    height: 48px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radiusField);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23697386' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E") no-repeat right 14px center;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
    appearance: none;
    cursor: pointer;
    outline: none;
}

.countrySelect:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}

.inputAdornment {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.cardInputRowPan .stripeInputBare {
    padding-right: 108px;
}

.brandSlot {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 52px;
    height: 24px;
}

.brandSlot .brandImg {
    display: none;
    height: 22px;
    align-items: center;
    justify-content: center;
}

.brandSlot .brandMaster {
    width: 34px;
}

.brandSlot[data-brand=""] .brandVisa,
.brandSlot[data-brand=""] .brandMaster,
.brandSlot[data-brand="unknown"] .brandVisa,
.brandSlot[data-brand="unknown"] .brandMaster {
    display: inline-flex;
}

.brandSlot[data-brand=""] .brandGeneric,
.brandSlot[data-brand="unknown"] .brandGeneric {
    display: none;
}

.brandSlot[data-brand="mada"] .brandMada {
    display: inline-block;
}

.brandSlot[data-brand="visa"] .brandVisa {
    display: inline-flex;
}

.brandSlot[data-brand="mastercard"] .brandMaster {
    display: inline-block;
}

.brandSlot[data-brand="amex"] .brandAmex {
    display: inline-flex;
    background: #2e77bb;
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 3px 6px;
    border-radius: 3px;
}

.brandMada {
    object-fit: contain;
}

.logoVisa {
    font-family: Arial, sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 18px;
    color: #1a1f71;
    letter-spacing: -0.5px;
}

.logoMaster {
    position: relative;
    width: 34px;
    height: 22px;
}

.logoMaster .mcRed,
.logoMaster .mcYellow {
    position: absolute;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.logoMaster .mcRed {
    left: 0;
    background: #eb001b;
}

.logoMaster .mcYellow {
    right: 0;
    background: #f79e1b;
    mix-blend-mode: multiply;
}

.pan {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.cvcCardGlyph {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.errorBanner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 4px;
    background: #fef3f2;
    border: 1px solid #fda29b;
    border-radius: var(--radiusField);
    color: #912018;
    font-size: 13px;
    line-height: 1.4;
}

.errorBanner svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.stripeInput.invalid,
.stripeInputBare.invalid {
    border-color: #df1b41;
}

.cardInputShell:has(.stripeInputBare.invalid) {
    border-color: #df1b41;
    box-shadow: 0 0 0 3px rgba(223, 27, 65, 0.12);
}

.payBtn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: var(--radiusBtn);
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.payBtn:hover {
    background: var(--primaryHover);
}

.payBtn:active {
    transform: translateY(1px);
}

.payBtn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.4);
}

.payBtn:disabled {
    background: #a599ff;
    cursor: not-allowed;
}

.payBtn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 10px;
    vertical-align: middle;
    animation: spin 0.7s linear infinite;
}

.payBtn.loading .spinner {
    display: inline-block;
}

.payBtn.loading .payLabel {
    opacity: 0.9;
}

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

.stripeFooter {
    margin: 8px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--textMuted);
    line-height: 1.5;
}

.stripeWordmark {
    font-weight: 700;
    font-style: italic;
    letter-spacing: -0.02em;
    color: #635bff;
}

.stripeFooterSep {
    margin: 0 6px;
    opacity: 0.6;
}

.stripeFooterLink {
    color: var(--textMuted);
    text-decoration: none;
    margin: 0 4px;
}

.stripeFooterLink:hover {
    text-decoration: underline;
    color: var(--text);
}

@media (max-width: 420px) {
    .stripeHeader {
        padding: 12px 16px 16px;
    }

    .stripeFormArea {
        padding: 16px 12px 28px;
    }

    .summaryAmount {
        font-size: 24px;
    }
}
