/* ============================================================
   CHECKOUT PAGE
   Extends the tokens already defined in css/style.css
   (--royal, --gold, --light, --radius, --shadow-*, etc.)
   ============================================================ */

.checkout-body {
    background: var(--light);
    min-height: 100vh;
}

/* ---------- Mini nav ---------- */
.co-nav {
    padding: 1.4rem 0;
    background: #030b1d;
}

.co-nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.co-nav .logo {
    color: #fff;
}

.co-back {
    color: rgba(255, 255, 255, .75);
    font-size: .9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.co-back:hover {
    color: var(--gold);
}

/* ---------- Layout ---------- */
.checkout-main {
    padding: clamp(2.5rem, 6vw, 5rem) 0 5rem;
}

.checkout-container {
    display: flex;
    justify-content: center;
}

.co-card {
    width: 100%;
    max-width: 620px;
    background: #fff;
    /* border-radius: var(--radius-lg); */
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.8rem, 4vw, 3rem);
}

.co-center {
    text-align: center;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.co-card-head {
    text-align: center;
    margin-bottom: 2.2rem;
}

.co-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 1rem;
    background: var(--gradient-soft);
    color: var(--royal);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.co-card-head h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin-bottom: .8rem;
}

.co-card-head p {
    font-size: .95rem;
    max-width: 460px;
    margin: 0 auto;
}

/* ---------- Form ---------- */
.donation-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.field-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: .6rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.field-group input {
    width: 100%;
    padding: .9rem 1.1rem;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    color: var(--gray);
    background: var(--light);
    transition: all .25s var(--ease);
}

.field-group input:focus {
    outline: none;
    border-color: var(--royal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(21, 62, 144, .1);
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .7rem;
    margin-bottom: .9rem;
}

.amount-chip {
    padding: .8rem .5rem;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--light);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: .85rem;
    color: var(--gray);
    cursor: pointer;
    transition: all .25s var(--ease);
}

.amount-chip:hover {
    border-color: var(--gold);
}

.amount-chip.active {
    background: var(--royal);
    border-color: var(--royal);
    color: #fff;
}

.custom-amount {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--light);
    overflow: hidden;
    transition: all .25s var(--ease);
}

.custom-amount:focus-within {
    border-color: var(--royal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(21, 62, 144, .1);
}

.custom-amount .prefix {
    padding: 0 0 0 1.1rem;
    font-weight: 700;
    color: var(--gray-soft);
}

.custom-amount input {
    border: none;
    background: transparent;
    padding: .9rem 1.1rem;
    font-size: .95rem;
    width: 100%;
}

.custom-amount input:focus {
    outline: none;
}

.form-error {
    display: none;
    color: #b3261e;
    background: #fdecea;
    border: 1px solid #f5c6c3;
    padding: .8rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
}

.form-error.show {
    display: block;
}

.co-submit {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 1.05rem 1.8rem;
}

.co-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none !important;
}

.co-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    font-size: .78rem;
    color: var(--gray-soft);
    margin-top: .4rem;
}

.co-trust i {
    color: var(--royal);
    margin-right: .35rem;
}

/* ---------- Verifying state ---------- */
.co-spinner {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 4px solid var(--border);
    border-top-color: var(--royal);
    margin: 0 auto 1.6rem;
    animation: coSpin 1s linear infinite;
}

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

.co-center h2 {
    font-size: 1.4rem;
    margin-bottom: .7rem;
}

.co-center p {
    max-width: 380px;
    margin: 0 auto;
}

/* ---------- Failed state ---------- */
.co-status-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 1.4rem;
    font-size: 1.6rem;
}

.co-status-icon--error {
    background: #fdecea;
    color: #b3261e;
}

.co-center .btn {
    margin-top: 1.6rem;
}

/* ---------- Receipt / seal ---------- */
.co-receipt {
    text-align: center;
}

.co-seal {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.4rem;
}

.co-seal svg {
    width: 100%;
    height: 100%;
}

.seal-ring {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2.5;
    stroke-dasharray: 6 5;
    transform-origin: 60px 60px;
    animation: sealRotate 30s linear infinite;
}

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

.seal-core {
    fill: var(--gradient-dark, var(--royal));
    fill: var(--royal);
}

.seal-check {
    stroke: var(--gold);
}

.co-receipt h2 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
}

.co-receipt-sub {
    max-width: 420px;
    margin: 0 auto 2rem;
    font-size: .95rem;
}

.receipt-box {
    text-align: left;
    background: var(--light);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.8rem;
    margin-bottom: 1.8rem;
}

.receipt-box-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
    border-bottom: 1.5px dashed var(--border);
}

.receipt-org {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--gray);
}

.receipt-tag {
    font-size: .78rem;
    color: var(--gray-soft);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: .2rem;
}

.receipt-amount {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--royal);
    white-space: nowrap;
}

.receipt-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem 1.5rem;
}

.receipt-details div {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.receipt-details dt {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-soft);
    font-weight: 600;
}

.receipt-details dd {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .88rem;
    color: var(--gray);
    word-break: break-word;
}

.receipt-ref {
    grid-column: 1 / -1;
}

.receipt-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .field-row {
        grid-template-columns: 1fr;
    }

    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .receipt-details {
        grid-template-columns: 1fr;
    }

    .receipt-box-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .receipt-actions {
        flex-direction: column;
    }

    .receipt-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
