/**
 * MindExams customer payment-page styles.
 *
 * Plain CSS only. Scoped to the Payment plugin's frontend markup.
 */

.mindexams-payment-page,
.mindexams-payment-result {
    --me-payment-text: #1f2937;
    --me-payment-muted: #4b5563;
    --me-payment-border: #d1d5db;
    --me-payment-surface: #ffffff;
    --me-payment-soft-surface: #f8fafc;
    --me-payment-action: #166534;
    --me-payment-action-hover: #14532d;
    --me-payment-focus: #1d4ed8;
    --me-payment-success-surface: #f0fdf4;
    --me-payment-success-border: #86efac;
    --me-payment-unavailable-surface: #fff7ed;
    --me-payment-unavailable-border: #fdba74;

    box-sizing: border-box;
    width: min(100%, 760px);
    margin: 2rem auto;
    color: var(--me-payment-text);
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.mindexams-payment-page *,
.mindexams-payment-page *::before,
.mindexams-payment-page *::after,
.mindexams-payment-result *,
.mindexams-payment-result *::before,
.mindexams-payment-result *::after {
    box-sizing: inherit;
}

.mindexams-payment-page__header,
.mindexams-payment-page__purchase,
.mindexams-payment-page__after,
.mindexams-payment-result {
    border: 1px solid var(--me-payment-border);
    border-radius: 0.75rem;
    background: var(--me-payment-surface);
    padding: clamp(1rem, 3vw, 2rem);
}

.mindexams-payment-page__purchase,
.mindexams-payment-page__after {
    margin-top: 1rem;
}

.mindexams-payment-page h1,
.mindexams-payment-page h2,
.mindexams-payment-result h2 {
    margin-top: 0;
    color: var(--me-payment-text);
    line-height: 1.25;
}

.mindexams-payment-page p,
.mindexams-payment-result p {
    margin-top: 0;
}

.mindexams-payment-page p:last-child,
.mindexams-payment-result p:last-child {
    margin-bottom: 0;
}

.mindexams-payment-page__purchase {
    text-align: center;
    background: var(--me-payment-soft-surface);
}

.mindexams-payment-page__term {
    margin-bottom: 0.25rem;
    color: var(--me-payment-muted);
    font-weight: 600;
}

.mindexams-payment-page__price {
    margin: 0.25rem 0 1.25rem;
    font-size: clamp(1.75rem, 6vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
}

.mindexams-payment-page__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    border: 2px solid var(--me-payment-action);
    border-radius: 0.5rem;
    background: var(--me-payment-action);
    color: #ffffff;
    padding: 0.7rem 1.4rem;
    font: inherit;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.mindexams-payment-page__button:hover {
    border-color: var(--me-payment-action-hover);
    background: var(--me-payment-action-hover);
    color: #ffffff;
    text-decoration: none;
}

.mindexams-payment-page__button:focus-visible {
    outline: 3px solid var(--me-payment-focus);
    outline-offset: 3px;
}

.mindexams-payment-page__button:disabled,
.mindexams-payment-page__button[aria-disabled="true"] {
    border-color: #6b7280;
    background: #6b7280;
    cursor: not-allowed;
    opacity: 0.85;
}

.mindexams-payment-page__status {
    min-height: 1.6em;
    margin-top: 1rem;
    color: var(--me-payment-muted);
}

.mindexams-payment-page__status:empty {
    min-height: 0;
    margin-top: 0;
}

.mindexams-payment-result {
    text-align: left;
}

.mindexams-payment-result--success {
    border-color: var(--me-payment-success-border);
    background: var(--me-payment-success-surface);
}

.mindexams-payment-result--unavailable {
    border-color: var(--me-payment-unavailable-border);
    background: var(--me-payment-unavailable-surface);
}

.mindexams-payment-result:focus {
    outline: none;
}

.mindexams-payment-result:focus-visible {
    outline: 3px solid var(--me-payment-focus);
    outline-offset: 3px;
}

.mindexams-payment-result__details {
    margin: 1rem 0 0;
}

.mindexams-payment-result__details > div {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr;
    gap: 0.5rem 1rem;
    align-items: baseline;
}

.mindexams-payment-result__details dt {
    font-weight: 700;
}

.mindexams-payment-result__details dd {
    margin: 0;
}

.mindexams-payment-page .screen-reader-text,
.mindexams-payment-result .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .mindexams-payment-page,
    .mindexams-payment-result {
        margin: 1rem auto;
    }

    .mindexams-payment-page__button {
        width: 100%;
    }

    .mindexams-payment-result__details > div {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

@media (forced-colors: active) {
    .mindexams-payment-page__button {
        border: 2px solid ButtonText;
    }
}
