/* Checkout page — luxury polish (black + #FFD333 gold) */

.checkout-page {
    font-family: 'Roboto', sans-serif;
    color: #222;
    padding: 24px 0 60px;
    /* Reserve vertical space so the !hydrated placeholder doesn't collapse
       and then snap to the full form height on hydration (CLS mitigation). */
    min-height: 80vh;
}

.checkout-breadcrumb {
    max-width: 1120px;
    margin: 0 auto 20px;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.checkout-breadcrumb__item {
    color: #888;
    text-decoration: none;
    transition: color 140ms ease;
}
.checkout-breadcrumb__item:hover {
    color: #111;
    text-decoration: none;
}
.checkout-breadcrumb__item.is-active {
    color: #111;
    border-bottom: 2px solid #FFD333;
    padding-bottom: 2px;
}
.checkout-breadcrumb__sep {
    color: #ccc;
    font-weight: 400;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}
@media (min-width: 992px) {
    .checkout-grid {
        grid-template-columns: minmax(0, 1fr) 400px;
        align-items: start;
    }
}

.checkout-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #111;
    margin: 0 0 24px;
}

/* ============ Form ============ */
.checkout-form {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 28px;
}

.checkout-alert {
    background: #fcebea;
    border: 1px solid #f5c6c4;
    color: #a4271b;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.88rem;
    margin-bottom: 20px;
}
.checkout-alert--inline {
    margin-top: 16px;
    margin-bottom: 0;
}

.checkout-field {
    margin-bottom: 18px;
}
.checkout-field__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 8px;
}
.checkout-field__input,
.checkout-field__select,
.checkout-field__textarea {
    width: 100%;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    padding: 11px 14px;
    font-size: 0.95rem;
    color: #222;
    font-family: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    appearance: none;
    -webkit-appearance: none;
}
.checkout-field__input:focus,
.checkout-field__select:focus,
.checkout-field__textarea:focus {
    outline: none;
    border-color: #FFD333;
    box-shadow: 0 0 0 3px rgba(255, 211, 51, 0.25);
}
.checkout-field__textarea {
    resize: vertical;
    min-height: 72px;
}
.checkout-field__select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23666' d='M6 8 0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    color: #222;
}
.checkout-field__select option {
    color: #222;
    background: #fff;
}

/* Kill Chrome/Edge autofill blue/yellow tint */
.checkout-field__input:-webkit-autofill,
.checkout-field__input:-webkit-autofill:hover,
.checkout-field__input:-webkit-autofill:focus,
.checkout-field__select:-webkit-autofill,
.checkout-field__select:-webkit-autofill:hover,
.checkout-field__select:-webkit-autofill:focus,
.checkout-field__textarea:-webkit-autofill,
.checkout-field__textarea:-webkit-autofill:hover,
.checkout-field__textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #222 !important;
    caret-color: #222;
    transition: background-color 9999s ease-in-out 0s;
}

.checkout-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
@media (min-width: 576px) {
    .checkout-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

.checkout-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: #FFD333;
    color: #111;
    border: 1px solid #FFD333;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
    margin-top: 8px;
}
.checkout-submit:hover:not(:disabled) {
    background: #f0c520;
    border-color: #f0c520;
}
.checkout-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.checkout-note {
    font-size: 0.78rem;
    color: #888;
    margin: 12px 0 0;
    line-height: 1.55;
    text-align: center;
}

/* ============ Order summary ============ */
.checkout-summary {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 24px;
}
@media (min-width: 992px) {
    .checkout-summary {
        position: sticky;
        top: 24px;
    }
}

.checkout-summary__list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}
.checkout-summary__line {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #ececec;
}
.checkout-summary__line:first-child {
    padding-top: 0;
}
.checkout-summary__line:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.checkout-summary__thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.checkout-summary__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.checkout-summary__thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 1.2rem;
}

.checkout-summary__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.checkout-summary__name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #111;
    margin: 0;
    line-height: 1.3;
}
.checkout-summary__meta {
    font-size: 0.78rem;
    color: #888;
    margin-top: 3px;
}
.checkout-summary__line-total {
    font-size: 0.92rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
}

.checkout-summary__totals {
    border-top: 2px solid #111;
    padding-top: 16px;
}
.checkout-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.checkout-summary__row-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #555;
}
.checkout-summary__row-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
}

/* ============ Fieldset reset (used to disable all fields during submit) ============ */
.checkout-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.checkout-fieldset[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}
.checkout-fieldset[disabled] .checkout-field__input,
.checkout-fieldset[disabled] .checkout-field__select,
.checkout-fieldset[disabled] .checkout-field__textarea {
    background: #f6f6f6;
    color: #777;
}

/* ============ Inline spinner (CSS-only, no FA dependency on submit path) ============ */
.spinner-dot {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spinner-spin 600ms linear infinite;
    margin-right: 10px;
    vertical-align: -2px;
}
@keyframes spinner-spin {
    to { transform: rotate(360deg); }
}

/* ============ Confirmation pages (success / failed) ============ */
.confirmation {
    font-family: 'Roboto', sans-serif;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 20px 96px;
    color: #222;
    background:
        radial-gradient(ellipse 80% 420px at 50% 0%, rgba(212, 175, 55, 0.10), transparent 70%),
        linear-gradient(180deg, #faf7ef 0%, #ffffff 360px);
}

.confirmation__card {
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 18px;
    padding: 52px 34px 44px;
    text-align: center;
    box-shadow: 0 22px 56px -24px rgba(17, 17, 17, 0.14),
                0 2px 6px rgba(17, 17, 17, 0.04);
    overflow: hidden;
}
.confirmation__card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4af37 0%, #FFD333 50%, #d4af37 100%);
}
.confirmation__card--fail::before {
    background: linear-gradient(90deg, #e74c3c 0%, #f5b041 50%, #e74c3c 100%);
}

/* Animated success check */
.confirmation__check-svg {
    width: 92px;
    height: 92px;
    display: block;
    margin: 0 auto 18px;
    filter: drop-shadow(0 8px 20px rgba(212, 175, 55, 0.28));
}
.confirmation__check-ring {
    stroke: #d4af37;
    stroke-width: 2.5;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    transform-origin: 50% 50%;
    animation: check-ring-draw 560ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.confirmation__check-mark {
    stroke: #d4af37;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: check-mark-draw 380ms cubic-bezier(0.65, 0, 0.35, 1) 500ms forwards;
}
@keyframes check-ring-draw { to { stroke-dashoffset: 0; } }
@keyframes check-mark-draw { to { stroke-dashoffset: 0; } }

/* Pending spinner ring */
.confirmation__pending-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    border: 3px solid rgba(212, 175, 55, 0.18);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: confirm-ring-spin 900ms linear infinite;
}
@keyframes confirm-ring-spin { to { transform: rotate(360deg); } }

/* Fail icon */
.confirmation__fail-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #fdecea;
    color: #c0392b;
    border: 2px solid #f5c6c4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 18px;
}

/* Ribbon */
.confirmation__ribbon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6d0a;
    font-size: 0.70rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.confirmation__ribbon--fail {
    background: #fdecea;
    color: #b93a2a;
}
.confirmation__ribbon-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
}
.confirmation__ribbon--fail .confirmation__ribbon-dot {
    background: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}

/* Title + subtitle */
.confirmation__title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #111;
    margin: 0 0 10px;
    line-height: 1.18;
}
.confirmation__subtitle {
    font-size: 0.96rem;
    color: #555;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 460px;
}

/* Summary strip */
.confirmation__summary {
    display: flex;
    margin: 26px 0 0;
    padding: 0;
    border: 1px solid #efe7d2;
    border-radius: 12px;
    background: #fbf8ef;
    overflow: hidden;
}
.confirmation__summary-item {
    flex: 1;
    padding: 14px 18px;
    text-align: left;
    margin: 0;
}
.confirmation__summary-item + .confirmation__summary-item {
    border-left: 1px solid #efe7d2;
    text-align: right;
}
.confirmation__summary-label {
    display: block;
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8a7e5b;
    margin: 0 0 4px;
    font-weight: 700;
}
.confirmation__summary-value {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.01em;
    margin: 0;
}

/* What happens next timeline */
.confirmation__timeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
.confirmation__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px 16px;
    border: 1px solid #f0ece1;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
}
.confirmation__step-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    color: #b38f20;
    font-size: 1rem;
}
.confirmation__step--active .confirmation__step-icon {
    background: rgba(212, 175, 55, 0.18);
    color: #8a6d0a;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
    animation: confirm-step-pulse 1.8s ease-in-out infinite;
}
.confirmation__step--done .confirmation__step-icon {
    background: #d4af37;
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(212, 175, 55, 0.55);
}
@keyframes confirm-step-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12); }
    50%      { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.04); }
}
.confirmation__step-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #111;
}
.confirmation__step-sub {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.4;
}

.confirmation__note {
    margin: 22px 0 0;
    font-size: 0.85rem;
    color: #777;
    line-height: 1.55;
}
.confirmation__note a {
    color: #8a6d0a;
    font-weight: 600;
}

/* Actions */
.confirmation__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
}
.confirmation__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 48px;
    padding: 0 26px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease,
                transform 160ms ease, box-shadow 160ms ease;
}
.confirmation__btn--primary {
    background: #FFD333;
    color: #111;
    border-color: #FFD333;
}
.confirmation__btn--primary:hover {
    background: #f0c520;
    border-color: #f0c520;
    color: #111;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -8px rgba(255, 211, 51, 0.6);
}
.confirmation__btn--ghost {
    background: #fff;
    color: #111;
    border-color: #d9d2bf;
}
.confirmation__btn--ghost:hover {
    background: #faf7ef;
    border-color: #d4af37;
    color: #111;
    text-decoration: none;
}

@media (max-width: 560px) {
    .confirmation { padding: 40px 14px 72px; }
    .confirmation__card { padding: 40px 20px 36px; }
    .confirmation__title { font-size: 1.55rem; }
    .confirmation__timeline { grid-template-columns: 1fr; }
    .confirmation__summary { flex-direction: column; }
    .confirmation__summary-item + .confirmation__summary-item {
        border-left: 0;
        border-top: 1px solid #efe7d2;
        text-align: left;
    }
    .confirmation__btn { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .confirmation__check-ring,
    .confirmation__check-mark {
        animation: none;
        stroke-dashoffset: 0;
    }
    .confirmation__pending-ring,
    .confirmation__step--active .confirmation__step-icon {
        animation: none;
    }
}

/* ============ Empty / loading states ============ */
.checkout-placeholder {
    text-align: center;
    padding: 72px 24px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.checkout-placeholder__icon {
    font-size: 2.4rem;
    color: #d4af37;
    margin-bottom: 16px;
}
.checkout-placeholder__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 10px;
}
.checkout-placeholder__text {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 24px;
}
.checkout-placeholder__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 28px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: #FFD333;
    color: #111;
    border: 1px solid #FFD333;
    text-decoration: none;
    transition: background 160ms ease;
}
.checkout-placeholder__link:hover {
    background: #f0c520;
    color: #111;
    text-decoration: none;
}

/* ============ Error toast ============
   Rendered position:fixed so it can't shift the form layout when it appears
   (avoids the big jump the user saw after the Paystack error fires). */
.checkout-toast {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(520px, calc(100vw - 32px));
    width: max-content;
    background: #fff;
    color: #a4271b;
    border: 1px solid #f5c6c4;
    border-left: 4px solid #c0392b;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 12px 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    animation: checkout-toast-in 180ms ease-out;
}
.checkout-toast__text {
    flex: 1 1 auto;
}
.checkout-toast__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #a4271b;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}
.checkout-toast__close:hover {
    color: #111;
}
@keyframes checkout-toast-in {
    from { opacity: 0; transform: translate(-50%, -6px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
@media (max-width: 575px) {
    .checkout-toast {
        top: 72px;
        font-size: 0.85rem;
    }
}
