/**
 * Verbandsportal — einheitliche Buttons im CD (seit 1.14.1).
 *
 * Einzige Quelle fuer das Button-Design: schraeger Rahmen-Button in der
 * Primaerfarbe, Text bleibt aufrecht (jedes direkte Kind-Element wird
 * zurueckgeneigt). Wird nach portal.css/shortcodes.css geladen und von den
 * eigenstaendigen Vorlagen (Login, Passwort setzen) direkt eingebunden.
 *
 * Markup: <button class="vp-btn vp-btn-primary"><span>Text</span></button>
 * (Text ohne <span> wird per shortcodes.js automatisch umschlossen.)
 */

.vp-btn-primary,
.vp-btn-secondary,
.vp-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
    margin: 0;
    transform: skew(-30deg);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 0;
    box-shadow: none;
    font-family: inherit;
    font-style: normal;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

/* Inhalt aufrecht stellen (Text-Span, Icons, Spinner-Wrapper) */
.vp-btn-primary > *,
.vp-btn-secondary > *,
.vp-btn-danger > * {
    display: inline-block;
    transform: skew(30deg);
}

.vp-btn-primary span span,
.vp-btn-secondary span span,
.vp-btn-danger span span {
    transform: none;
}

/* Primaer: Portal-Farbe, gross */
.vp-btn-primary {
    color: var(--vp-primary, #12957f);
    border-color: var(--vp-primary, #12957f);
    font-size: 22px;
    padding: 12px 34px;
}

.vp-btn-primary:hover:not(:disabled),
.vp-btn-primary:focus-visible {
    background: var(--vp-primary-light, rgba(18, 149, 127, 0.12));
    color: var(--vp-primary, #12957f);
}

/* Sekundaer: gleiche Form, neutral; Hover in Portal-Farbe */
.vp-btn-secondary {
    color: #333;
    border-color: #9a9a9a;
    font-size: 16px;
    padding: 9px 26px;
}

.vp-btn-secondary:hover:not(:disabled),
.vp-btn-secondary:focus-visible {
    background: transparent;
    color: var(--vp-primary, #12957f);
    border-color: var(--vp-primary, #12957f);
}

/* Gefahr (Loeschen) */
.vp-btn-danger {
    color: #b32d2e;
    border-color: #b32d2e;
    font-size: 16px;
    padding: 9px 26px;
}

.vp-btn-danger:hover:not(:disabled),
.vp-btn-danger:focus-visible {
    background: #b32d2e;
    color: #fff;
}

.vp-btn-primary:disabled,
.vp-btn-secondary:disabled,
.vp-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vp-btn-primary:focus-visible,
.vp-btn-secondary:focus-visible,
.vp-btn-danger:focus-visible {
    outline: 2px solid var(--vp-primary, #12957f);
    outline-offset: 3px;
}

/* Volle Breite: Ueberstand der Schraege ausgleichen */
.vp-btn-full {
    width: calc(100% - 28px);
    margin-left: 14px;
    margin-right: 14px;
}

.vp-btn-sm {
    font-size: 14px;
    padding: 6px 18px;
}

/* Abstand nach Formularfeldern (Formulare, Dialoge, Passwort-Formulare);
   margin-left gleicht den Ueberstand der Schraege aus */
.vp-form > .vp-btn-primary,
.vp-form > .vp-btn-secondary,
.vp-modal form > .vp-btn-primary,
.vp-modal form > .vp-btn-secondary,
.vp-forgot-box form > .vp-btn-primary {
    margin-top: 16px;
    margin-left: 14px;
}

@media (max-width: 600px) {
    .vp-btn-primary {
        font-size: 18px;
        padding: 10px 28px;
    }
}

/* Bewusst gerade gestellte Buttons (Inline-Style skew(0)) nicht zurueckneigen */
.vp-btn-primary[style*="skew(0"] > *,
.vp-btn-secondary[style*="skew(0"] > * {
    transform: none;
}
