/*
    Styling for the shared eBay policy editor.

    Served at _content/PokeChase.Ebay.Components/ebay-policies.css and linked by both hosts. Written
    entirely against the custom properties the website and the app BOTH define (--canvas, --surface,
    --line, --text, --text-muted, --accent), so it inherits each host's palette — including the app's
    light theme — instead of hardcoding a second one. Fallbacks match the dark palette in case a host
    loads this before its own variables.

    This file exists because the first cut used Bootstrap's list-group/alert classes, whose defaults
    are light-themed: on the app's near-black canvas they rendered as white slabs.
*/

.ebay-policy-manager,
.ebay-policy-form,
.ebay-return-form {
    color: var(--text, #F3F1FB);
}

.ebay-policy-manager h4,
.ebay-policy-manager h5 {
    color: var(--text, #F3F1FB);
}

.pcp-muted {
    color: var(--text-muted, #A7A3C0);
}

/* ── Notices ──────────────────────────────────────────────────────────── */

.pcp-notice {
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line, #2A2741);
    border-radius: var(--radius, 0.85rem);
    background: var(--surface, #181430);
    color: var(--text, #F3F1FB);
}

.pcp-notice--ok {
    border-color: rgba(79, 215, 155, 0.5);
    background: rgba(79, 215, 155, 0.12);
}

.pcp-notice--error {
    border-color: rgba(255, 107, 87, 0.55);
    background: rgba(255, 107, 87, 0.12);
}

/* The form's own validation list — same treatment as an error notice. */
.pcp-errors {
    padding: 0.75rem 0.9rem 0.75rem 1.6rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 107, 87, 0.55);
    border-radius: var(--radius, 0.85rem);
    background: rgba(255, 107, 87, 0.12);
    color: var(--text, #F3F1FB);
}

.pcp-errors li + li {
    margin-top: 0.3rem;
}

/* ── Lists of policies ────────────────────────────────────────────────── */

.pcp-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.pcp-section-head h4 {
    margin: 0;
}

.pcp-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    border: 1px solid var(--line, #2A2741);
    border-radius: var(--radius, 0.85rem);
    background: var(--surface, #181430);
    overflow: hidden;
}

.pcp-item {
    padding: 0.85rem 0.95rem;
}

.pcp-item + .pcp-item {
    border-top: 1px solid var(--line, #2A2741);
}

.pcp-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pcp-item--row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pcp-item-meta {
    margin-top: 0.2rem;
    font-size: 0.86rem;
    color: var(--text-muted, #A7A3C0);
}

.pcp-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pcp-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-wash, rgba(124, 92, 255, 0.16));
    border: 1px solid var(--accent-line, rgba(124, 92, 255, 0.45));
    color: var(--text, #F3F1FB);
}

.pcp-cta {
    margin-bottom: 1.5rem;
}

/* ── The collapsed "managed by PokeChase" group ───────────────────────── */

.pcp-managed {
    margin-bottom: 1.75rem;
    border: 1px solid var(--line, #2A2741);
    border-radius: var(--radius, 0.85rem);
    background: color-mix(in srgb, var(--surface, #181430) 60%, transparent);
}

.pcp-managed > summary {
    padding: 0.7rem 0.95rem;
    cursor: pointer;
    color: var(--text-muted, #A7A3C0);
}

.pcp-managed-body {
    padding: 0 0.95rem 0.95rem;
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.ebay-policy-form .form-label,
.ebay-return-form .form-label {
    color: var(--text, #F3F1FB);
    font-weight: 600;
}

.ebay-policy-form .form-text,
.ebay-return-form .form-text,
.ebay-policy-form .form-check-label,
.ebay-return-form .form-check-label {
    color: var(--text-muted, #A7A3C0);
}

/* Bootstrap's control defaults are white-on-white here; match the host surface instead. */
.ebay-policy-form .form-control,
.ebay-policy-form .form-select,
.ebay-return-form .form-control,
.ebay-return-form .form-select {
    background: var(--canvas, #0E0B1A);
    border: 1px solid var(--line, #2A2741);
    color: var(--text, #F3F1FB);
}

.ebay-policy-form .form-control:focus,
.ebay-policy-form .form-select:focus,
.ebay-return-form .form-control:focus,
.ebay-return-form .form-select:focus {
    background: var(--canvas, #0E0B1A);
    border-color: var(--accent, #7C5CFF);
    color: var(--text, #F3F1FB);
    box-shadow: 0 0 0 0.2rem var(--accent-wash, rgba(124, 92, 255, 0.16));
}

.ebay-policy-form .form-control::placeholder,
.ebay-return-form .form-control::placeholder {
    color: var(--text-muted, #A7A3C0);
    opacity: 0.7;
}

/* Native dropdown popups take the option colours, not the select's — without this the open list
   is unreadable on some platforms. */
.ebay-policy-form .form-select option,
.ebay-policy-form .form-select optgroup,
.ebay-return-form .form-select option {
    background: var(--surface, #181430);
    color: var(--text, #F3F1FB);
}

.pcp-service-row {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--line, #2A2741);
    border-radius: var(--radius, 0.85rem);
    background: color-mix(in srgb, var(--surface, #181430) 70%, transparent);
}

.pcp-form-section {
    margin-top: 1.75rem;
}
