:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    --ink: #17231e;
    --ink-soft: #626a65;
    --line: #dde1da;
    --surface: #fffdf8;
    --canvas: #f4f0e7;
    --green: #1f4d3b;
    --green-deep: #173229;
    --green-soft: #356955;
    --sky: #b8d9e7;
    --pink: #d9687f;
    --gold: #f4d85b;
    --success: #2c7756;
    --error: #a93745;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 0, rgba(184, 217, 231, 0.52), transparent 432px),
        radial-gradient(circle at 7% 92%, rgba(231, 168, 79, 0.13), transparent 330px),
        var(--canvas);
}

button,
input,
a {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.payment-shell {
    width: min(1040px, 100%);
    min-height: 640px;
    display: grid;
    grid-template-columns: minmax(300px, 36%) minmax(0, 64%);
    overflow: hidden;
    border: 1px solid rgba(23, 35, 30, 0.09);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(31, 77, 59, 0.14);
}

.brand-panel {
    position: relative;
    min-height: 640px;
    padding: 38px 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background:
        radial-gradient(circle at 78% 25%, rgba(184, 217, 231, 0.38), transparent 34%),
        radial-gradient(circle at 14% 90%, rgba(231, 168, 79, 0.20), transparent 36%),
        linear-gradient(155deg, var(--green-deep) 5%, var(--green) 59%, var(--green-soft) 100%);
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.brand-panel::before {
    width: 420px;
    height: 420px;
    left: -250px;
    bottom: -135px;
}

.brand-panel::after {
    width: 210px;
    height: 210px;
    top: 110px;
    right: -148px;
}

.brand-logo {
    width: min(196px, 72%);
    height: auto;
    position: relative;
    z-index: 2;
}

.brand-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 214px;
    height: 214px;
    margin: 0;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
}

.brand-visual > img {
    width: 140px;
    height: auto;
    position: relative;
    z-index: 3;
    filter: drop-shadow(0 20px 22px rgba(4, 25, 18, 0.30));
}

.orbit,
.brand-glow {
    position: absolute;
    border-radius: 50%;
}

.orbit {
    border: 1px solid rgba(255, 255, 255, 0.21);
}

.orbit-large {
    inset: 5px;
    transform: rotate(18deg);
}

.orbit-small {
    inset: 36px;
    transform: rotate(-26deg);
}

.brand-glow {
    inset: 66px;
    background: rgba(255, 255, 255, 0.18);
    filter: blur(24px);
}

.orbit::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 8px rgba(244, 216, 91, 0.10);
}

.orbit-large::after {
    top: 28px;
    right: 30px;
}

.orbit-small::after {
    left: 8px;
    bottom: 48px;
    background: #f59ab2;
}

.payment-panel {
    min-width: 0;
    padding: 42px 44px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 100% 0, rgba(184, 217, 231, 0.28), transparent 36%),
        var(--surface);
}

.form-screen,
.result-screen {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-screen {
    max-width: 540px;
    margin: 0 auto;
}

.result-screen {
    max-width: 460px;
    margin: 0 auto;
    align-items: center;
    text-align: center;
}

h1 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: clamp(28px, 3.3vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.lead-text {
    max-width: 520px;
    margin: 0 0 28px;
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.5;
}

.result-screen .lead-text {
    max-width: 430px;
}

.payment-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.input-field {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink-soft);
    background: rgba(255, 253, 248, 0.90);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-field:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31, 77, 59, 0.10);
}

.input-field svg {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.currency-icon {
    width: 21px;
    display: inline-grid;
    place-items: center;
    font-size: 21px;
    line-height: 1;
}

.input-field input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 16px;
}

.input-field input::placeholder {
    color: #929893;
}

.input-field strong {
    color: var(--ink);
    font-weight: 600;
}

.primary-button {
    width: 100%;
    min-height: 54px;
    padding: 13px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    color: #fffdf8;
    background: linear-gradient(135deg, #2f6651, var(--green));
    box-shadow: 0 12px 24px rgba(31, 77, 59, 0.20);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 28px rgba(31, 77, 59, 0.27);
}

.primary-button:focus-visible {
    outline: 3px solid rgba(31, 77, 59, 0.30);
    outline-offset: 3px;
}

.primary-button:disabled {
    cursor: wait;
    transform: none;
}

.primary-button svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.form-alert {
    margin: 0 0 22px;
    padding: 13px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid rgba(169, 55, 69, 0.22);
    border-radius: 13px;
    color: #7e2934;
    background: rgba(220, 92, 107, 0.09);
    font-size: 14px;
    line-height: 1.45;
}

.form-alert > span {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--error);
    font-size: 12px;
    font-weight: 800;
}

.form-alert p {
    margin: 1px 0 0;
}

.progress-ring,
.success-icon,
.fail-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.progress-ring {
    border: 5px solid #e1e9e4;
    border-top-color: var(--green);
    animation: spin 1.4s linear infinite;
}

.progress-ring span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 8px rgba(31, 77, 59, 0.10);
}

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

.success-icon {
    color: #fff;
    background: var(--success);
    box-shadow: 0 12px 30px rgba(44, 119, 86, 0.24);
}

.success-icon svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fail-icon {
    color: #fff;
    background: var(--error);
    box-shadow: 0 12px 30px rgba(169, 55, 69, 0.22);
}

.fail-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.payment-summary {
    width: 100%;
    margin: 0 0 22px;
    padding: 20px;
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(244, 240, 231, 0.72);
    text-align: left;
}

.payment-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.payment-summary dt,
.payment-summary dd {
    margin: 0;
}

.payment-summary dt {
    color: var(--ink-soft);
}

.payment-summary dd {
    color: var(--ink);
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.redirect-form {
    width: 100%;
}

@media (max-width: 720px) {
    body {
        padding: 14px;
        align-items: start;
    }

    .payment-shell {
        grid-template-columns: 1fr;
        min-height: 0;
        border-radius: 24px;
    }

    .brand-panel {
        min-height: 150px;
        padding: 26px 24px;
    }

    .brand-logo {
        width: 176px;
    }

    .brand-visual {
        display: none;
    }

    .payment-panel {
        min-height: 520px;
        padding: 34px 22px 28px;
    }

    .form-screen,
    .result-screen {
        justify-content: flex-start;
    }

    h1 {
        font-size: 28px;
    }
}

@media (max-width: 390px) {
    body {
        padding: 8px;
    }

    .payment-panel {
        padding-inline: 22px;
    }

    .payment-summary > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .payment-summary dd {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
