/*
 * Standalone payment page (template-checkout.php).
 * Scoped to body.prufio-checkout-page so it never leaks onto other templates.
 * Shared chrome (topbar, CSS variables) lives in minimal-page.css, loaded
 * alongside this file.
 */

body.prufio-checkout-page .checkout-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 32px 64px;
}

body.prufio-checkout-page .checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

body.prufio-checkout-page .checkout-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.prufio-checkout-page .checkout-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

body.prufio-checkout-page .checkout-section-label {
    font-family: var(--pf-text);
    font-size: 14px;
    font-weight: 600;
    color: var(--pf-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

body.prufio-checkout-page .checkout-section-label a {
    color: var(--pf-green-ink);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.prufio-checkout-page .checkout-section-label a:hover {
    color: var(--pf-green-deep);
}

body.prufio-checkout-page .checkout-card {
    background: #fff;
    border: 1px solid #dfe8e1;
    border-radius: 18px;
    padding: 26px 28px;
}

body.prufio-checkout-page .checkout-card h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
}

/* ─── Email row ──────────────────────────────────────── */
body.prufio-checkout-page .checkout-email-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7faf8;
    border: 1px solid #e1eae3;
    border-radius: 12px;
    padding: 12px 12px 12px 18px;
}

body.prufio-checkout-page .checkout-mail {
    color: #7e8f86;
    flex: 0 0 auto;
    display: flex;
}

body.prufio-checkout-page .checkout-addr {
    flex: 1 1 auto;
    font-family: var(--pf-text);
    font-size: 15.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.prufio-checkout-page .checkout-email-row input {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: none;
    outline: none;
    font-family: var(--pf-text);
    font-size: 15.5px;
    color: var(--pf-ink);
    padding: 0;
}

body.prufio-checkout-page .checkout-ghost {
    background: #fff;
    border: 1.5px solid #cfdbd2;
    border-radius: 999px;
    font-family: var(--pf-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--pf-ink);
    padding: 9px 20px;
    cursor: pointer;
    flex: 0 0 auto;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
}

body.prufio-checkout-page .checkout-ghost:hover {
    border-color: var(--pf-green-deep);
    color: var(--pf-green-deep);
}

/* ─── Invoice toggle ─────────────────────────────────── */
body.prufio-checkout-page .checkout-biz-card {
    padding: 22px 28px;
}

body.prufio-checkout-page .checkout-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

body.prufio-checkout-page .checkout-switch-label {
    font-size: 15.5px;
    font-weight: 600;
}

body.prufio-checkout-page .checkout-switch {
    flex: 0 0 auto;
    width: 56px;
    height: 32px;
    border-radius: 999px;
    border: 0;
    padding: 3px;
    cursor: pointer;
    background: #dfe5e1;
    display: flex;
    align-items: center;
    transition: background 0.16s ease;
}

body.prufio-checkout-page .checkout-switch .checkout-knob {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    display: block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.16s ease;
}

body.prufio-checkout-page .checkout-switch[aria-checked="true"] {
    background: var(--pf-green-deep);
}

body.prufio-checkout-page .checkout-switch[aria-checked="true"] .checkout-knob {
    transform: translateX(24px);
}

body.prufio-checkout-page .checkout-biz-fields {
    display: none;
    margin-top: 20px;
    gap: 16px;
    flex-direction: column;
}

body.prufio-checkout-page .checkout-biz-fields.open {
    display: flex;
}

body.prufio-checkout-page .checkout-fieldset label {
    display: block;
    font-family: var(--pf-text);
    font-size: 14px;
    font-weight: 500;
    color: var(--pf-muted);
    margin-bottom: 8px;
}

body.prufio-checkout-page .checkout-fieldset input {
    width: 100%;
    height: 52px;
    border: 1.5px solid #d6e0d8;
    border-radius: 12px;
    padding: 0 16px;
    font-family: var(--pf-text);
    font-size: 15.5px;
    color: var(--pf-ink);
    outline: none;
    transition: border-color 0.12s ease;
}

body.prufio-checkout-page .checkout-fieldset input::placeholder {
    color: #9aa8a0;
}

body.prufio-checkout-page .checkout-fieldset input:focus {
    border-color: var(--pf-green-deep);
}

body.prufio-checkout-page .checkout-fieldset.error input {
    border-color: #c0472f;
}

body.prufio-checkout-page .checkout-field-error {
    display: none;
    align-items: flex-start;
    gap: 9px;
    margin: 10px 0 0;
    font-family: var(--pf-text);
    font-size: 13.5px;
    line-height: 1.45;
    color: #c0472f;
}

body.prufio-checkout-page .checkout-field-error svg {
    flex: 0 0 auto;
    margin-top: 1px;
}

body.prufio-checkout-page .checkout-fieldset.error .checkout-field-error {
    display: flex;
}

/* #checkoutBankError / #checkoutPayError aren't inside a .checkout-fieldset,
   so they're shown/hidden directly via the [hidden] attribute instead. */
body.prufio-checkout-page #checkoutBankError:not([hidden]),
body.prufio-checkout-page #checkoutPayError:not([hidden]) {
    display: flex;
}

/* ─── Quick pay ──────────────────────────────────────── */
body.prufio-checkout-page .checkout-quickpay {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.prufio-checkout-page .checkout-paybtn-dark {
    height: 54px;
    width: 100%;
    background: #000;
    color: #fff;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--pf-ui);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s ease;
}

body.prufio-checkout-page .checkout-paybtn-dark:hover:not(:disabled) {
    opacity: 0.86;
}

body.prufio-checkout-page .checkout-paybtn-dark:disabled {
    background: #d9dedb;
    color: #93a29a;
    cursor: not-allowed;
}

body.prufio-checkout-page .checkout-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: var(--pf-muted);
    font-family: var(--pf-text);
    font-size: 13.5px;
}

body.prufio-checkout-page .checkout-divider::before,
body.prufio-checkout-page .checkout-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pf-line);
}

body.prufio-checkout-page h3.checkout-methods-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
}

/* ─── Payment methods ────────────────────────────────── */
body.prufio-checkout-page .checkout-method {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    position: relative;
    background: #fff;
    border: 1.5px solid #e1eae3;
    border-radius: 12px;
    padding: 17px 18px;
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        background 0.12s ease;
}

body.prufio-checkout-page .checkout-method + .checkout-method {
    margin-top: 10px;
}

body.prufio-checkout-page .checkout-method:hover {
    border-color: #bedcc1;
}

body.prufio-checkout-page .checkout-method input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

body.prufio-checkout-page .checkout-radio {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #c3d0c7;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease;
}

body.prufio-checkout-page .checkout-radio::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pf-green-deep);
    transform: scale(0);
    transition: transform 0.12s ease;
}

body.prufio-checkout-page .checkout-method input:checked ~ .checkout-radio {
    border-color: var(--pf-green-deep);
}

body.prufio-checkout-page
    .checkout-method
    input:checked
    ~ .checkout-radio::after {
    transform: scale(1);
}

body.prufio-checkout-page .checkout-method:has(input:checked) {
    border-color: var(--pf-green-bright);
    background: var(--pf-green-tint);
}

body.prufio-checkout-page
    .checkout-method
    input:focus-visible
    ~ .checkout-radio {
    outline: 2px solid var(--pf-green-deep);
    outline-offset: 3px;
}

body.prufio-checkout-page .checkout-m-name {
    flex: 1 1 auto;
    font-size: 15.5px;
    font-weight: 600;
}

body.prufio-checkout-page .checkout-m-marks {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

body.prufio-checkout-page .checkout-mark {
    font-family: var(--pf-text);
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7a72;
    background: #f2f6f3;
    border: 1px solid #e4ebe6;
    border-radius: 6px;
    padding: 5px 8px;
    white-space: nowrap;
}

body.prufio-checkout-page .checkout-method:has(input:checked) .checkout-mark {
    background: #fff;
    border-color: #d5e7d7;
}

/* Bank marks carrying a BIC (see the "Value (BIC code)" ACF field) are
   selectable — clicking/activating one picks that specific bank for the
   "Online banking" method. Marks without a data-bic (e.g. card brand marks)
   stay purely decorative. */
body.prufio-checkout-page .checkout-mark[data-bic] {
    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}

body.prufio-checkout-page .checkout-mark[data-bic]:hover {
    border-color: var(--pf-green-bright);
}

body.prufio-checkout-page .checkout-mark[data-bic]:focus-visible {
    outline: 2px solid var(--pf-green-deep);
    outline-offset: 2px;
}

body.prufio-checkout-page
    .checkout-method.selected
    .checkout-mark[data-bic].selected {
    background: var(--pf-green-deep) !important;
    border-color: var(--pf-green-deep) !important;
    color: #fff !important;
}

/* ─── Pay button ─────────────────────────────────────── */
body.prufio-checkout-page .checkout-paybtn {
    margin-top: 24px;
    width: 100%;
    min-height: 60px;
    background: var(--pf-green-bright);
    color: #06382f;
    border: 0;
    border-radius: 999px;
    font-family: var(--pf-ui);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition:
        background 0.12s ease,
        transform 0.08s ease;
}

body.prufio-checkout-page .checkout-paybtn:hover:not(:disabled) {
    background: var(--pf-green-bright-hover);
}

body.prufio-checkout-page .checkout-paybtn:active:not(:disabled) {
    transform: translateY(1px);
}

body.prufio-checkout-page .checkout-paybtn:disabled {
    background: #e3ebe5;
    color: #93a29a;
    cursor: not-allowed;
}

body.prufio-checkout-page .checkout-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(6, 56, 47, 0.35);
    border-top-color: #06382f;
    border-radius: 50%;
    animation: prufio-checkout-spin 0.7s linear infinite;
}

body.prufio-checkout-page .checkout-spinner[hidden] {
    display: none;
}

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

/* ─── Order summary ──────────────────────────────────── */
body.prufio-checkout-page .checkout-summary {
    padding: 0;
    overflow: hidden;
}

body.prufio-checkout-page .checkout-summary-head {
    background: linear-gradient(150deg, #0e5449 0%, #07443b 55%, #04302a 100%);
    color: #fff;
    padding: 24px 26px 22px;
}

body.prufio-checkout-page .checkout-head-top {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

body.prufio-checkout-page .checkout-head-mark {
    height: 26px;
    width: auto;
    display: block;
}

body.prufio-checkout-page .checkout-pack[hidden] {
    display: none;
}

body.prufio-checkout-page .checkout-pack {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

body.prufio-checkout-page .checkout-pack-name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

body.prufio-checkout-page .checkout-pack-note {
    font-family: var(--pf-text);
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 6px;
}

body.prufio-checkout-page .checkout-pack-prices {
    text-align: right;
    flex: 0 0 auto;
}

body.prufio-checkout-page .checkout-pack-price {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.015em;
}

body.prufio-checkout-page .checkout-pack-was {
    font-family: var(--pf-text);
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: line-through;
    margin-top: 4px;
}

body.prufio-checkout-page .checkout-chip[hidden] {
    display: none;
}

body.prufio-checkout-page .checkout-chip {
    display: inline-block;
    margin-top: 14px;
    background: var(--pf-yellow);
    color: #3a2e00;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 7px;
    padding: 5px 10px;
}

body.prufio-checkout-page .checkout-summary-body {
    padding: 24px 26px 26px;
}

body.prufio-checkout-page .checkout-coupon-link {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: var(--pf-ui);
    font-size: 15px;
    font-weight: 600;
    color: var(--pf-green-deep);
    text-decoration: underline;
    text-underline-offset: 4px;
}

body.prufio-checkout-page .checkout-coupon-link:hover {
    color: var(--pf-green-bright-hover);
}

body.prufio-checkout-page .checkout-coupon-form {
    display: none;
    gap: 10px;
    margin-top: 14px;
}

body.prufio-checkout-page .checkout-coupon-form.open {
    display: flex;
}
body.prufio-checkout-page
    .checkout-coupon-form:not(.open)
    + .checkout-coupon-msg {
    display: none;
}
body.prufio-checkout-page .checkout-coupon-form input {
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
    border: 1.5px solid #d6e0d8;
    border-radius: 12px;
    padding: 0 16px;
    font-family: var(--pf-text);
    font-size: 15px;
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.12s ease;
}

body.prufio-checkout-page .checkout-coupon-form input::placeholder {
    text-transform: none;
    color: #9aa8a0;
}

body.prufio-checkout-page .checkout-coupon-form input:focus {
    border-color: var(--pf-green-deep);
}

body.prufio-checkout-page .checkout-coupon-form button {
    flex: 0 0 auto;
    height: 50px;
    padding: 0 22px;
    border-radius: 12px;
    border: 1.5px solid var(--pf-green-deep);
    background: #fff;
    color: var(--pf-green-deep);
    font-family: var(--pf-ui);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.12s ease,
        color 0.12s ease;
}

body.prufio-checkout-page .checkout-coupon-form button:hover {
    background: var(--pf-green-deep);
    color: #fff;
}

body.prufio-checkout-page .checkout-coupon-msg {
    margin: 10px 0 0;
    font-family: var(--pf-text);
    font-size: 13px;
    display: none;
}

body.prufio-checkout-page .checkout-coupon-msg.ok {
    display: block;
    color: #1e6b3c;
}

body.prufio-checkout-page .checkout-coupon-msg.bad {
    display: block;
    color: var(--pf-danger);
}

body.prufio-checkout-page hr.checkout-rule {
    border: 0;
    border-top: 1px solid #eaf0eb;
    margin: 22px 0;
}

body.prufio-checkout-page .checkout-line[hidden] {
    display: none;
}

body.prufio-checkout-page .checkout-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--pf-text);
    font-size: 14.5px;
    color: var(--pf-muted);
    margin-bottom: 10px;
}

body.prufio-checkout-page .checkout-line strong {
    font-family: var(--pf-ui);
    font-weight: 600;
    color: var(--pf-ink);
}

body.prufio-checkout-page .checkout-total-block {
    background: var(--pf-green-tint);
    border: 1px solid #d2e9d5;
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 16px;
}

body.prufio-checkout-page .checkout-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

body.prufio-checkout-page .checkout-total-label {
    font-size: 18px;
    font-weight: 700;
}

body.prufio-checkout-page .checkout-total-value {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pf-green-deep);
}

body.prufio-checkout-page .checkout-saving[hidden] {
    display: none;
}

body.prufio-checkout-page .checkout-saving {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    font-family: var(--pf-ui);
    font-size: 13.5px;
    font-weight: 700;
    color: #06382f;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
}

@media (max-width: 960px) {
    body.prufio-checkout-page .checkout-main {
        padding: 24px 16px 48px;
    }
    body.prufio-checkout-page .checkout-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    body.prufio-checkout-page .checkout-summary-col {
        order: -1;
    }
    body.prufio-checkout-page .checkout-card {
        padding: 22px 20px;
    }
    body.prufio-checkout-page .checkout-summary {
        padding: 0;
    }
    body.prufio-checkout-page
        .checkout-m-marks
        .checkout-mark:nth-child(n + 3) {
        display: none;
    }
}
