/*
 * Teyo Player checkout styles
 *
 * Extends the tokens already defined in teyo-0.5.0.css. No new palette is
 * introduced: the dark navy surface and teal accent stay exactly as they are.
 */

:root {
    --checkout-radius: 14px;
    --checkout-gap: 16px;
    --field-height: 48px;
}

/* Accessibility ---------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 12px 18px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    border-radius: 0 0 var(--checkout-radius) 0;
}

.skip-link:focus {
    left: 0;
}

:where(a, button, input, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Trust list ------------------------------------------------------------- */

.trust-list {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.trust-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.trust-list svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--accent);
}

/* Method chooser --------------------------------------------------------- */

.checkout {
    display: block;
}

.method-chooser {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 20px;
}

.method-chooser[hidden] {
    display: none;
}

.method-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--field-height);
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--checkout-radius);
    background: var(--panel);
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.method-tab svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.method-tab:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--accent);
}

.method-tab.is-active {
    background: var(--panel-strong);
    border-color: var(--accent);
    color: var(--text);
}

.method-tab:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.method-tab[hidden] {
    display: none;
}

/* PayPal button area ----------------------------------------------------- */

#paypal-button-container {
    min-height: 52px;
}

.checkout-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.checkout-fallback {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--checkout-radius);
    color: var(--muted);
    font-size: 14px;
}

/* Hosted card fields ------------------------------------------------------
   The inner element is a PayPal iframe. We style the wrapper only; the fields
   themselves are styled through the SDK style object in teyo-checkout.js. */

.card-label {
    display: block;
    margin: 0 0 var(--checkout-gap);
}

.card-label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.card-field {
    height: var(--field-height);
    padding: 0 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--background-soft);
    transition: border-color 0.15s ease;
}

.card-field:focus-within {
    border-color: var(--accent);
}

.card-field iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--checkout-gap);
}

#card-form .primary-button {
    width: 100%;
    margin-top: 4px;
}

#card-form .primary-button:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* Footer / cancel -------------------------------------------------------- */

.checkout-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.checkout-expiry {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.cancel-form {
    margin: 0;
}

.link-button {
    padding: 6px 2px;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--danger);
}

/* Alert variants used by the checkout script ----------------------------- */

.alert.info {
    border-color: var(--border);
    color: var(--text);
}

.alert[hidden] {
    display: none;
}

/* Busy state ------------------------------------------------------------- */

.checkout[aria-busy='true'] .method-chooser,
.checkout[aria-busy='true'] .cancel-form {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 560px) {
    .method-chooser {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .checkout-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .method-tab {
        justify-content: flex-start;
    }
}

/* Large TV browsers: keep hit targets generous and text legible ----------- */

@media (min-width: 1600px) {
    .method-tab,
    .card-field {
        min-height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .method-tab,
    .card-field {
        transition: none;
    }
}
