/*
 * WiderrufPilot - shared front-end and admin styles.
 *
 * The front-end UI is intentionally self-contained: all colours, spacing and
 * typography are driven by CSS custom properties scoped to `.widerrufpilot`,
 * so the plugin looks consistent on top of any WordPress theme and can be
 * re-skinned by overriding a handful of variables.
 */

.widerrufpilot {
    --wfp-accent: #2563eb;
    --wfp-accent-hover: #1d4ed8;
    --wfp-accent-soft: #eff4ff;
    --wfp-success: #15803d;
    --wfp-success-soft: #f0fdf4;
    --wfp-danger: #b91c1c;
    --wfp-danger-soft: #fef2f2;
    --wfp-ink: #111827;
    --wfp-muted: #5b6470;
    --wfp-line: #e3e6eb;
    --wfp-surface: #ffffff;
    --wfp-radius: 14px;
    --wfp-radius-sm: 9px;
    --wfp-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 12px 28px -12px rgba(17, 24, 39, .18);
}

.widerrufpilot--frontend {
    color: var(--wfp-ink);
    font-size: 16px;
    line-height: 1.55;
}

.widerrufpilot--frontend * {
    box-sizing: border-box;
}

/* ---------- Card ---------- */
.widerrufpilot-card {
    max-width: 760px;
    margin: 0 0 1.5rem;
    padding: 1.75rem 1.9rem;
    border: 1px solid var(--wfp-line);
    border-radius: var(--wfp-radius);
    background: var(--wfp-surface);
    box-shadow: var(--wfp-shadow);
}

.widerrufpilot-card--success {
    border-color: #bbf7d0;
}

.widerrufpilot-card__title {
    margin: 0 0 .5rem;
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
}

.widerrufpilot-card__intro {
    margin: 0 0 1.1rem;
    color: var(--wfp-muted);
}

/* ---------- Step indicator ---------- */
.widerrufpilot-steps {
    display: flex;
    gap: .5rem;
    margin: 0 0 1.4rem;
    padding: 0;
    list-style: none;
    counter-reset: wfp-step;
}

.widerrufpilot-steps li {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .7rem;
    border-radius: var(--wfp-radius-sm);
    background: #f4f5f7;
    color: var(--wfp-muted);
    font-size: .82rem;
    font-weight: 600;
}

.widerrufpilot-steps li::before {
    counter-increment: wfp-step;
    content: counter(wfp-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #d7dae0;
    color: #fff;
    font-size: .78rem;
}

.widerrufpilot-steps li.is-active {
    background: var(--wfp-accent-soft);
    color: var(--wfp-accent-hover);
}

.widerrufpilot-steps li.is-active::before {
    background: var(--wfp-accent);
}

.widerrufpilot-steps li.is-done {
    color: var(--wfp-success);
    background: var(--wfp-success-soft);
}

.widerrufpilot-steps li.is-done::before {
    background: var(--wfp-success);
    content: "\2713";
}

@media (max-width: 540px) {
    .widerrufpilot-steps li span {
        display: none;
    }
}

/* ---------- Fields ---------- */
.widerrufpilot-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

.widerrufpilot-field label {
    font-weight: 600;
}

.widerrufpilot-field input,
.widerrufpilot-field textarea {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #c3c8d0;
    border-radius: var(--wfp-radius-sm);
    background: #fff;
    font-size: 1rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.widerrufpilot-field input:focus,
.widerrufpilot-field textarea:focus {
    outline: 0;
    border-color: var(--wfp-accent);
    box-shadow: 0 0 0 3px var(--wfp-accent-soft);
}

.widerrufpilot-field__hint {
    font-size: .82rem;
    color: var(--wfp-muted);
}

/* ---------- Buttons ---------- */
.widerrufpilot-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .7rem 1.4rem;
    border: 1px solid transparent;
    border-radius: var(--wfp-radius-sm);
    background: #eef0f3;
    color: var(--wfp-ink);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, transform .05s ease;
}

.widerrufpilot-button:hover {
    background: #e3e6ea;
    color: var(--wfp-ink);
}

.widerrufpilot-button:active {
    transform: translateY(1px);
}

.widerrufpilot-button--primary,
.widerrufpilot-button--confirm {
    background: var(--wfp-accent);
    color: #fff;
}

.widerrufpilot-button--primary:hover,
.widerrufpilot-button--confirm:hover {
    background: var(--wfp-accent-hover);
    color: #fff;
}

.widerrufpilot-button--confirm {
    padding-inline: 1.8rem;
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .8);
}

.widerrufpilot-button--small {
    padding: .4rem .85rem;
    font-size: .85rem;
}

.widerrufpilot-link {
    background: none;
    border: 0;
    color: var(--wfp-accent);
    cursor: pointer;
    padding: 0;
    font-size: .92rem;
    text-decoration: underline;
}

.widerrufpilot-link:hover {
    color: var(--wfp-accent-hover);
}

.widerrufpilot-actions {
    margin-top: 1.25rem;
}

.widerrufpilot-actions--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---------- Prominent "Vertrag widerrufen" CTA (footer-safe) ---------- */
.widerrufpilot-cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1.15rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    line-height: 1.2;
}

.widerrufpilot-cta::before {
    content: "\21BA";
    font-size: 1.05em;
}

.widerrufpilot-cta--solid {
    background: var(--wfp-accent);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .7);
}

.widerrufpilot-cta--solid:hover {
    background: var(--wfp-accent-hover);
    color: #fff;
}

.widerrufpilot-cta--outline {
    background: #fff;
    color: var(--wfp-accent);
    border: 2px solid var(--wfp-accent);
}

.widerrufpilot-cta--outline:hover {
    background: var(--wfp-accent-soft);
}

/* Wrapper used by the shared Button helper (widget + block + shortcode). */
.widerrufpilot-cta-wrapper {
    margin: .5rem 0;
}

.widerrufpilot-cta-intro {
    margin: 0 0 .65rem;
    font-size: .95rem;
    line-height: 1.45;
    color: var(--wfp-muted);
}

.widerrufpilot-cta-wrapper--align-center {
    text-align: center;
}

.widerrufpilot-cta-wrapper--align-right {
    text-align: right;
}

.widerrufpilot-cta-wrapper--align-left {
    text-align: left;
}

.widerrufpilot-bulk {
    display: flex;
    gap: 1.25rem;
    margin-bottom: .75rem;
}

/* ---------- Tables ---------- */
.widerrufpilot-deadline {
    margin: 0 0 1rem;
    padding: .55rem .85rem;
    border-radius: var(--wfp-radius-sm);
    background: var(--wfp-accent-soft);
    color: var(--wfp-accent-hover);
    font-size: .9rem;
}

.widerrufpilot-items {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: .95rem;
}

.widerrufpilot-items th,
.widerrufpilot-items td {
    text-align: left;
    padding: .7rem .55rem;
    border-bottom: 1px solid var(--wfp-line);
    vertical-align: top;
}

.widerrufpilot-items thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--wfp-muted);
}

.widerrufpilot-items tfoot th,
.widerrufpilot-items tfoot td {
    border-bottom: 0;
    border-top: 2px solid var(--wfp-line);
    font-size: 1rem;
}

.widerrufpilot-items__name {
    display: block;
    font-weight: 600;
}

.widerrufpilot-items__sku {
    display: block;
    font-size: .8rem;
    color: var(--wfp-muted);
}

.widerrufpilot-qty {
    width: 5rem;
    padding: .4rem .5rem;
    border: 1px solid #c3c8d0;
    border-radius: var(--wfp-radius-sm);
    font-size: 1rem;
}

/* ---------- Summary list ---------- */
.widerrufpilot-summary {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
}

.widerrufpilot-summary li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px dashed var(--wfp-line);
}

.widerrufpilot-summary__label {
    color: var(--wfp-muted);
}

.widerrufpilot-summary__value {
    text-align: right;
    font-weight: 600;
}

/* ---------- Review / receipt ---------- */
.widerrufpilot-review {
    margin: 1.25rem 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--wfp-line);
    border-radius: var(--wfp-radius);
    background: #fafbfc;
}

.widerrufpilot-review__heading {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
}

.widerrufpilot-review__message {
    margin: .75rem 0 0;
    padding-top: .75rem;
    border-top: 1px dashed var(--wfp-line);
}

.widerrufpilot-review__message .widerrufpilot-summary__label {
    display: block;
    margin-bottom: .2rem;
}

.widerrufpilot-receipt__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: .85rem;
    border-radius: 50%;
    background: var(--wfp-success);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.widerrufpilot-card--cancelled {
    border-color: #fca5a5;
}

.widerrufpilot-card--cancelled .widerrufpilot-receipt__badge {
    background: var(--wfp-danger, #dc2626);
}

.widerrufpilot-card__login,
.widerrufpilot-card__lookup {
    margin: 0 0 1.1rem;
    font-size: .92rem;
    color: var(--wfp-muted);
}

.widerrufpilot-cancel {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--wfp-line);
}

.widerrufpilot-cancel__intro {
    margin: 0 0 .6rem;
    font-size: .92rem;
    color: var(--wfp-muted);
}

.widerrufpilot-button--ghost {
    background: transparent;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}

.widerrufpilot-button--ghost:hover {
    background: var(--wfp-danger-soft, #fee2e2);
    color: #7f1d1d;
}

/* ---------- Notices ---------- */
.widerrufpilot-notice {
    padding: .8rem 1rem;
    border-radius: var(--wfp-radius-sm);
    margin-bottom: 1rem;
    font-size: .92rem;
}

.widerrufpilot-notice--error {
    background: var(--wfp-danger-soft);
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}

.widerrufpilot-notice--info {
    background: var(--wfp-accent-soft);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.widerrufpilot-notice--success {
    background: var(--wfp-success-soft);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.widerrufpilot-muted {
    color: var(--wfp-muted);
}

/* ---------- Status badges (shared front-end + admin) ---------- */
.widerrufpilot-status {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.6;
    background: #e2e4e7;
    color: #1d2327;
}

.widerrufpilot-status--received  { background: #e0e7ff; color: #312e81; }
.widerrufpilot-status--reviewing { background: #fef3c7; color: #92400e; }
.widerrufpilot-status--approved  { background: #dbeafe; color: #1e3a8a; }
.widerrufpilot-status--rejected  { background: #fee2e2; color: #991b1b; }
.widerrufpilot-status--refunded  { background: #dcfce7; color: #166534; }
.widerrufpilot-status--cancelled { background: #e5e7eb; color: #374151; }

a.widerrufpilot-status {
    text-decoration: none;
}

/* ---------- Customer status timeline ---------- */
.widerrufpilot-stepper {
    list-style: none;
    margin: 1.25rem 0 1.5rem;
    padding: 0;
    display: flex;
}

.widerrufpilot-stepper__step {
    flex: 1 1 0;
    position: relative;
    padding-top: 1.65rem;
    text-align: center;
    font-size: .82rem;
    line-height: 1.35;
    color: var(--wfp-muted);
}

/* connector line running from the previous dot into this one */
.widerrufpilot-stepper__step::before {
    content: "";
    position: absolute;
    top: 8px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #d1d5db;
}

.widerrufpilot-stepper__step:first-child::before {
    display: none;
}

/* status dot */
.widerrufpilot-stepper__step::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #d1d5db;
    box-sizing: border-box;
}

.widerrufpilot-stepper__step--done {
    color: #166534;
}

.widerrufpilot-stepper__step--done::before,
.widerrufpilot-stepper__step--current::before {
    background: #16a34a;
}

.widerrufpilot-stepper__step--done::after {
    background: #16a34a;
    border-color: #16a34a;
}

.widerrufpilot-stepper__step--current {
    color: #1d2327;
    font-weight: 600;
}

.widerrufpilot-stepper__step--current::after {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

@media (max-width: 600px) {
    .widerrufpilot-stepper {
        flex-direction: column;
        gap: .35rem;
    }

    .widerrufpilot-stepper__step {
        padding: .1rem 0 .1rem 1.75rem;
        text-align: left;
    }

    .widerrufpilot-stepper__step::before {
        top: -50%;
        left: 7px;
        width: 2px;
        height: 100%;
    }

    .widerrufpilot-stepper__step::after {
        top: 50%;
        left: 8px;
        transform: translate(-50%, -50%);
    }
}

/* ---------- Order-page withdrawal panel ---------- */
.widerrufpilot-order-panel {
    margin-top: 1.5rem;
}

/* ---------- Admin detail screen ---------- */
.widerrufpilot-admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 960px) {
    .widerrufpilot-admin-grid {
        grid-template-columns: 1fr;
    }
}

.widerrufpilot-panel {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.widerrufpilot-panel h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.widerrufpilot-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widerrufpilot-timeline li {
    padding: .6rem 0;
    border-bottom: 1px solid #f0f0f1;
}

.widerrufpilot-timeline__meta {
    display: block;
    font-size: .8rem;
    color: #787c82;
}

.widerrufpilot-deflist {
    margin: 0;
}

.widerrufpilot-deflist dt {
    font-weight: 600;
    color: #50575e;
    margin-top: .6rem;
}

.widerrufpilot-deflist dd {
    margin: .1rem 0 0;
}

/* ---------- Responsive tables ---------- */
@media (max-width: 600px) {
    .widerrufpilot-card {
        padding: 1.25rem;
    }

    .widerrufpilot-items thead {
        display: none;
    }

    .widerrufpilot-items tr {
        display: block;
        margin-bottom: .75rem;
        border: 1px solid var(--wfp-line);
        border-radius: var(--wfp-radius-sm);
        padding: .5rem;
    }

    .widerrufpilot-items td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border: 0;
    }

    .widerrufpilot-items td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--wfp-muted);
    }

    .widerrufpilot-actions--split {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .widerrufpilot-actions--split .widerrufpilot-button {
        width: 100%;
    }
}
