:root {
    --page-bg: #f6f8f7;
    --surface: #ffffff;
    --ink: #17202a;
    --muted: #64707d;
    --line: #dfe5e8;
    --primary: #285e61;
    --primary-dark: #183f42;
    --accent: #c8753f;
    --focus: rgba(40, 94, 97, 0.22);
    --shadow: 0 24px 70px rgba(23, 32, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(200, 117, 63, 0.16), transparent 34rem),
        linear-gradient(145deg, #f6f8f7 0%, #eef4f1 46%, #f8faf9 100%);
}

button,
input,
select {
    font: inherit;
}

.payment-shell {
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 520px);
    gap: 48px;
    align-items: center;
}

.payment-intro {
    padding: 48px 0;
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.payment-intro h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1;
    letter-spacing: 0;
}

.intro-copy {
    max-width: 500px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.payment-panel {
    background: var(--surface);
    border: 1px solid rgba(23, 32, 42, 0.08);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.payment-form {
    padding: 32px;
}

.field-group {
    margin-bottom: 22px;
}

.field-group label {
    display: block;
    margin-bottom: 9px;
    color: #2d3742;
    font-size: 0.95rem;
    font-weight: 750;
}

.field-group input,
.field-group select {
    width: 100%;
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field-group input {
    padding: 0 16px;
}

.field-group select {
    appearance: none;
    padding: 0 46px 0 16px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--primary) 50%),
        linear-gradient(135deg, var(--primary) 50%, transparent 50%);
    background-position:
        calc(100% - 21px) 50%,
        calc(100% - 15px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.field-group input::placeholder {
    color: #a6afb8;
}

.field-group input:focus,
.field-group select:focus,
.amount-control:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus);
}

.amount-control {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.amount-control span {
    display: grid;
    place-items: center;
    border-right: 1px solid var(--line);
    background: #f1f5f3;
    color: var(--primary-dark);
    font-weight: 850;
}

.amount-control input {
    min-height: 54px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.amount-control input:focus {
    box-shadow: none;
}

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

.pay-button {
    width: 100%;
    min-height: 58px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 850;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.pay-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(24, 63, 66, 0.24);
}

.pay-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
    box-shadow: none;
}

.pay-button:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 3px;
}

.payment-message {
    min-height: 24px;
    margin: 16px 0 0;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
}

.payment-message[data-type="error"] {
    color: #9b2c2c;
}

.payment-message[data-type="success"] {
    color: #236345;
}

@media (max-width: 860px) {
    .payment-shell {
        width: min(640px, calc(100% - 28px));
        grid-template-columns: 1fr;
        gap: 24px;
        align-items: start;
        padding: 28px 0;
    }

    .payment-intro {
        padding: 8px 0 0;
    }

    .payment-intro h1 {
        font-size: clamp(2.25rem, 12vw, 3.25rem);
    }
}

@media (max-width: 560px) {
    body {
        min-height: 100dvh;
    }

    .payment-shell {
        width: 100%;
        min-height: 100dvh;
        padding: 0;
    }

    .payment-intro {
        min-height: auto;
        padding: 18px 20px 46px;
        background: linear-gradient(135deg, var(--primary-dark), var(--primary));
        color: #fff;
        text-align: center;
    }

    .eyebrow {
        margin: 0;
        color: #ffbe8f;
        font-size: 0.72rem;
    }

    .payment-intro h1,
    .intro-copy {
        display: none;
    }

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

    .field-group label {
        margin-bottom: 5px;
        font-size: 0.82rem;
    }

    .field-group input,
    .field-group select {
        min-height: 44px;
        border-radius: 5px;
    }

    .field-group input {
        padding: 0 12px;
    }

    .field-group select {
        padding: 0 38px 0 12px;
        background-position:
            calc(100% - 19px) 50%,
            calc(100% - 13px) 50%;
    }

    .payment-panel {
        margin-top: -28px;
        border-right: 0;
        border-left: 0;
        border-radius: 8px 8px 0 0;
        box-shadow: 0 -12px 36px rgba(23, 32, 42, 0.14);
    }

    .payment-form {
        padding: 16px 16px 18px;
    }

    .name-grid {
        gap: 12px;
    }

    .amount-control {
        grid-template-columns: 72px minmax(0, 1fr);
        min-height: 44px;
        border-radius: 5px;
    }

    .amount-control input {
        min-height: 42px;
    }

    .pay-button {
        min-height: 48px;
        margin-top: 4px;
        border-radius: 5px;
        font-size: 0.95rem;
    }

    .payment-message {
        min-height: 20px;
        margin-top: 10px;
        font-size: 0.84rem;
    }
}

@media (max-width: 360px) {
    .name-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
