/*
 * css/dks_widerruf.css
 * DKS Widerrufsformular – Frontend-Styles
 * Responsiv, barrierefrei, leicht zu überschreiben
 */

/* ── Basis-Reset im Plugin-Scope ─────────────────────────────────────────── */
.dks-wr-wrap *,
.dks-wr-wrap *::before,
.dks-wr-wrap *::after {
    box-sizing: border-box;
}

/* ── Container ───────────────────────────────────────────────────────────── */
.dks-wr-wrap {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: inherit;
    color: #1d1d1d;
}

/* ── Überschrift ──────────────────────────────────────────────────────────── */
.dks-wr-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1d1d1d;
}

.dks-wr-intro {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ── Empfänger-Block ──────────────────────────────────────────────────────── */
.dks-wr-recipient {
    background: #f5f5f5;
    border-left: 4px solid #2271b1;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
    line-height: 1.7;
    border-radius: 0 4px 4px 0;
}

/* ── Fieldset & Legend ───────────────────────────────────────────────────── */
.dks-wr-fieldset {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.dks-wr-legend {
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0 0.5rem;
    color: #1d1d1d;
}

/* ── Formular-Felder ─────────────────────────────────────────────────────── */
.dks-wr-field {
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dks-wr-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1d;
}

.dks-wr-label abbr {
    text-decoration: none;
    color: #c0392b;
    margin-left: 2px;
}

.dks-wr-input,
.dks-wr-textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    color: #1d1d1d;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

.dks-wr-input:focus,
.dks-wr-textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
    outline: none;
}

/* Gültig / Ungültig – native Browser-Validierung */
.dks-wr-input:invalid:not(:placeholder-shown),
.dks-wr-textarea:invalid:not(:placeholder-shown) {
    border-color: #c0392b;
}

.dks-wr-textarea {
    resize: vertical;
    min-height: 80px;
}

.dks-wr-input--date {
    max-width: 200px;
}

/* ── Zweispaltige Zeile ──────────────────────────────────────────────────── */
.dks-wr-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dks-wr-row .dks-wr-field {
    flex: 1 1 200px;
}

.dks-wr-field--plz {
    flex: 0 0 120px !important;
    min-width: 100px;
}

/* ── Hilfetext ───────────────────────────────────────────────────────────── */
.dks-wr-hint {
    font-size: 0.82rem;
    color: #666;
    margin-top: 2px;
}

/* ── Gesetzlicher Hinweis-Text ───────────────────────────────────────────── */
.dks-wr-legal {
    background: #fffbea;
    border: 1px solid #e5c84a;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #5a4a00;
}

.dks-wr-legal p {
    margin: 0 0 0.4rem;
}

.dks-wr-legal-note {
    font-size: 0.82rem !important;
    color: #7a6810 !important;
}

/* ── Absenden-Button ─────────────────────────────────────────────────────── */
.dks-wr-submit {
    margin-top: 0.5rem;
}

.dks-wr-btn {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.dks-wr-btn:hover,
.dks-wr-btn:focus {
    background: #1a5a99;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.3);
    outline: none;
}

.dks-wr-btn:active {
    background: #145085;
}

/* ── Pflichtfeld-Hinweis ─────────────────────────────────────────────────── */
.dks-wr-required-note {
    font-size: 0.82rem;
    color: #666;
    margin-top: 0.75rem;
}

/* ── Honeypot (für Bots sichtbar, für Nutzer versteckt) ──────────────────── */
.dks-wr-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-size: 0;
}

/* ── Erfolgs-Meldung ─────────────────────────────────────────────────────── */
.dks-wr-success {
    background: #edfaef;
    border: 1px solid #46b450;
    border-left-width: 4px;
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    color: #155724;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ── Fehler-Meldungen ────────────────────────────────────────────────────── */
.dks-wr-errors {
    background: #fdf2f2;
    border: 1px solid #dc3232;
    border-left-width: 4px;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    color: #7d2020;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.dks-wr-errors ul {
    margin: 0.5rem 0 0 1.2rem;
    padding: 0;
}

.dks-wr-errors li {
    margin-bottom: 0.25rem;
}

/* ── Hinweis (Shop nicht konfiguriert) ───────────────────────────────────── */
.dks-wr-notice {
    background: #fff8e5;
    border: 1px solid #f0b849;
    border-left-width: 4px;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    color: #5a3e00;
    margin-bottom: 1.5rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN-STYLES (geladen über wp_enqueue_style im Admin-Kontext)
   Prefix: .dks-wr-admin-wrap
═══════════════════════════════════════════════════════════════════════════ */

.dks-wr-admin-wrap {
    max-width: 1200px;
}

.dks-wr-admin-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem !important;
}

.dks-wr-version {
    font-size: 0.75rem;
    color: #888;
    font-weight: normal;
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.dks-wr-tabs {
    margin-bottom: 0 !important;
}

.dks-wr-badge {
    display: inline-block;
    background: #d63638;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Tab-Inhalt ──────────────────────────────────────────────────────────── */
.dks-wr-tab-content {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: none;
    padding: 1.5rem 2rem;
    border-radius: 0 0 4px 4px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.dks-wr-card {
    margin-bottom: 2rem;
}

.dks-wr-card-title {
    font-size: 1.1rem !important;
    font-weight: 700;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ── Setup-Wizard-Banner ─────────────────────────────────────────────────── */
.dks-wr-wizard-banner {
    background: linear-gradient(135deg, #2271b1 0%, #1a5a99 100%);
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.dks-wr-wizard-banner h2 {
    color: #fff !important;
    margin: 0 0 0.5rem !important;
    font-size: 1.3rem !important;
}

.dks-wr-wizard-banner p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.6;
}

/* ── Formular-Tabelle (Admin) ────────────────────────────────────────────── */
.dks-wr-form-table .required {
    color: #c0392b;
}

/* ── Listen-Tabelle ──────────────────────────────────────────────────────── */
.dks-wr-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dks-wr-total {
    font-size: 0.85rem;
    color: #888;
    font-weight: normal;
}

.dks-wr-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dks-wr-filter a {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.85rem;
    color: #2271b1;
    background: #f9f9f9;
    transition: background 0.15s;
}

.dks-wr-filter a:hover,
.dks-wr-filter-active {
    background: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
}

.dks-wr-ware-col {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Status-Badge ────────────────────────────────────────────────────────── */
.dks-wr-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.dks-wr-status--neu          { background: #fff3cd; color: #856404; }
.dks-wr-status--bearbeitet   { background: #d1e7dd; color: #0f5132; }
.dks-wr-status--archiviert   { background: #e2e3e5; color: #41464b; }

/* ── Detail-Tabelle ──────────────────────────────────────────────────────── */
.dks-wr-detail-table th {
    width: 160px;
    font-weight: 600;
}

.dks-wr-back-btn {
    margin-left: auto;
    font-size: 0.85rem !important;
}

/* ── Status-Formular ─────────────────────────────────────────────────────── */
.dks-wr-status-form {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dks-wr-status-sel {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.dks-wr-pagination {
    margin-top: 1rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* ── Einbindungs-Info ────────────────────────────────────────────────────── */
.dks-wr-howto {
    font-size: 0.95rem;
    line-height: 1.8;
    padding-left: 1.5rem;
}

.dks-wr-shortcode {
    display: inline-block;
    background: #1d1d1d;
    color: #7dd3fc;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.dks-wr-legal-hints {
    font-size: 0.95rem;
    line-height: 1.8;
    padding-left: 1.5rem;
}

/* ── Admin-Footer ────────────────────────────────────────────────────────── */
.dks-wr-admin-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.82rem;
    color: #888;
}

.dks-wr-empty {
    color: #888;
    font-style: italic;
    padding: 1rem 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .dks-wr-wrap {
        padding: 0 0.75rem;
    }

    .dks-wr-title {
        font-size: 1.3rem;
    }

    .dks-wr-row {
        flex-direction: column;
        gap: 0;
    }

    .dks-wr-field--plz {
        flex: 1 1 100% !important;
    }

    .dks-wr-btn {
        width: 100%;
        text-align: center;
    }

    .dks-wr-recipient {
        font-size: 0.9rem;
    }

    /* Admin */
    .dks-wr-list-header {
        flex-direction: column;
    }

    .dks-wr-tab-content {
        padding: 1rem;
    }

    .dks-wr-detail-table th {
        width: 120px;
    }
}

@media (max-width: 400px) {
    .dks-wr-fieldset {
        padding: 1rem;
    }

    .dks-wr-input,
    .dks-wr-textarea {
        font-size: 0.95rem;
    }
}

/* ── Hoher Kontrast / Forced Colors (Barrierefreiheit) ───────────────────── */
@media (forced-colors: active) {
    .dks-wr-btn {
        border: 2px solid ButtonText;
        forced-color-adjust: none;
    }

    .dks-wr-input:focus,
    .dks-wr-textarea:focus {
        outline: 3px solid Highlight;
    }
}

/* ── Reduzierte Bewegung ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .dks-wr-input,
    .dks-wr-textarea,
    .dks-wr-btn {
        transition: none;
    }
}


/* ══════════════════════════════════════════════════════════════════════════
   DOKU & HILFE TAB – Zusätzliche Styles
═══════════════════════════════════════════════════════════════════════════ */

/* ── Shortcode-Codeblock mit Kopieren-Button ─────────────────────────────── */
.dks-wr-code-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.dks-wr-code-block code {
    display: inline-block;
    background: #1d1d1d;
    color: #7dd3fc;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    font-family: monospace;
}

.dks-wr-copy-btn {
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: #1d1d1d;
    transition: background 0.15s;
    font-family: inherit;
}

.dks-wr-copy-btn:hover,
.dks-wr-copy-btn:focus {
    background: #dcdcde;
    outline: 2px solid #2271b1;
    outline-offset: 1px;
}

/* ── Feature-Grid ────────────────────────────────────────────────────────── */
.dks-wr-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.dks-wr-feature-item {
    display: flex;
    gap: 0.85rem;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 1rem 1.1rem;
    align-items: flex-start;
}

.dks-wr-feature-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.dks-wr-feature-item strong {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.dks-wr-feature-item p {
    margin: 0;
    font-size: 0.87rem;
    color: #555;
    line-height: 1.55;
}

.dks-wr-feature-item code {
    font-size: 0.82rem;
    background: #eee;
    padding: 1px 4px;
    border-radius: 3px;
}

/* ── Datenbank-Schema-Tabellen ───────────────────────────────────────────── */
.dks-wr-table-docs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.dks-wr-table-doc h3 {
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
    color: #1d1d1d;
}

.dks-wr-table-doc p {
    font-size: 0.87rem;
    color: #666;
    margin: 0 0 0.6rem;
}

.dks-wr-schema-table {
    font-size: 0.85rem !important;
}

.dks-wr-schema-table code {
    background: #eee;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* ── Rechtliche Box ──────────────────────────────────────────────────────── */
.dks-wr-card--legal {
    border-left: 4px solid #dba617;
}

.dks-wr-legal-box {
    background: #fffbea;
    border: 1px solid #e5c84a;
    border-radius: 4px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.dks-wr-legal-box h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
}

.dks-wr-legal-disclaimer {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #f0f0f1;
    border-radius: 4px;
    font-size: 0.87rem;
    color: #555;
}

/* ── TODO-Liste ──────────────────────────────────────────────────────────── */
.dks-wr-todo-intro {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.dks-wr-todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dks-wr-todo-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 0.85rem 1rem;
}

.dks-wr-todo-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.dks-wr-todo-tag--offen    { background: #fff3cd; color: #856404; }
.dks-wr-todo-tag--progress { background: #cfe2ff; color: #0a4d93; }
.dks-wr-todo-tag--done     { background: #d1e7dd; color: #0f5132; }

.dks-wr-todo-item strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.92rem;
}

.dks-wr-todo-item p {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

/* ── Changelog ───────────────────────────────────────────────────────────── */
.dks-wr-changelog {
    margin: 0;
}

.dks-wr-changelog dt {
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 0.75rem;
    color: #1d1d1d;
}

.dks-wr-changelog-date {
    font-weight: normal;
    color: #888;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.dks-wr-changelog dd ul {
    margin: 0.4rem 0 0 1.4rem;
    padding: 0;
}

.dks-wr-changelog dd li {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.7;
}

.dks-wr-changelog code {
    background: #eee;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.83rem;
}

/* ── Responsive Doku ─────────────────────────────────────────────────────── */
@media (max-width: 782px) {
    .dks-wr-feature-grid {
        grid-template-columns: 1fr;
    }

    .dks-wr-table-docs {
        grid-template-columns: 1fr;
    }

    .dks-wr-todo-item {
        flex-direction: column;
        gap: 0.4rem;
    }

    .dks-wr-code-block {
        flex-direction: column;
        align-items: flex-start;
    }
}
