/* BVE Kursmanagement — Frontend Styles */
/* Uses BVE design tokens: --bve-navy, --bve-blue, --bve-blue-light, --bve-blue-pale */

/* ── Variable scope anchor ───────────────────────────────────────────────────
   theme.css scopes --lp-* custom properties to .lp-wrapper.  Shortcode output
   lives outside that wrapper, so we redeclare the same tokens here on
   .lp-vars — a zero-overhead container with no layout side-effects.         */
.lp-vars {
    --lp-green: #16a34a;
    --lp-green-bg: #f0fdf4;
    --lp-yellow: #ecc94b;
    --lp-red: #c53030;
    --lp-red-bright: #e11d48;
    --lp-blue-bg: #f0f9ff;
    --lp-blue-soft: #e0f2fe;
    --lp-blue-border: #bae6fd;
    --lp-gray-bg: #f8fafc;
    --lp-gray-border: #e2e8f0;
    --lp-text: var(--bve-text);
    --lp-text-light: var(--bve-text);
    --lp-text-muted: var(--bve-text);
    --lp-text-slate: var(--bve-text-muted);
    --lp-radius-lg: 12px;
    --lp-radius-md: 8px;
    --lp-radius-pill: 50px;
    --lp-section-gap: 4rem;
}

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.bve-kurs-section {
    margin: 3rem 0;
    font-family: var(--bve-font, 'Quicksand', sans-serif);
}

.bve-kurs-section h2 {
    color: var(--bve-navy, #001f3a);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--bve-blue, #0077b6);
    padding-bottom: 0.5rem;
}

.bve-kurs-section h3 {
    color: var(--bve-navy, #001f3a);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* ── Price table ─────────────────────────────────────────────────────────── */
.bve-preise {
    background: var(--bve-blue-pale, #e8f4fc);
    border-left: 4px solid var(--bve-blue, #0077b6);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    max-width: 480px;
}

.bve-preise-table {
    width: 100%;
    border-collapse: collapse;
}

.bve-preise-table td {
    padding: 0.4rem 0;
    color: var(--bve-navy, #001f3a);
    font-size: 1rem;
}

.bve-preise-betrag {
    font-weight: 700;
    text-align: right;
    color: var(--bve-blue, #0077b6);
    font-size: 1.05rem;
}

/* ── No dates available ──────────────────────────────────────────────────── */
.bve-keine-termine {
    background: var(--bve-blue-pale, #e8f4fc);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

.bve-keine-termine p {
    color: var(--bve-navy, #001f3a);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

/* ── Session cards ───────────────────────────────────────────────────────── */
.bve-termine {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.bve-termin-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #dde8f0;
    border-left: 4px solid var(--bve-blue, #0077b6);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.bve-termin-info {
    flex: 1;
    min-width: 200px;
}

.bve-termin-datum {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bve-navy, #001f3a);
    margin-bottom: 0.3rem;
}

.bve-termin-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--bve-text);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.bve-termin-ort::before {
    content: "📍 ";
}

.bve-termin-plaetze {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    display: inline-block;
}

.bve-plaetze-frei {
    background: #d4edda;
    color: #155724;
}

.bve-plaetze-voll {
    background: #f8d7da;
    color: #721c24;
}

/* ── Session Anmelden button (per-row, small) ────────────────────────────── */
.lp-btn-sm {
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
    background: var(--bve-blue, #0077b6);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}
.lp-btn-sm:hover {
    background: var(--bve-navy, #001f3a);
}

/* ── Dialog / Overlay ────────────────────────────────────────────────────── */
.bve-anmelde-overlay {
    position: fixed;
    inset: 0;
    /* Override Gutenberg constrained-layout max-width/margin applied to block children */
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: rgba(0, 31, 58, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.bve-anmelde-dialog {
    background: #fff;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.bve-dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: var(--bve-navy, #001f3a);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bve-dialog-close:hover {
    color: var(--bve-blue, #0077b6);
}

.bve-dialog-title {
    color: var(--bve-navy, #001f3a);
    font-size: 1.2rem;
    margin: 0 2rem 0.25rem 0;
}

.bve-dialog-datum {
    color: var(--bve-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ── Form tabs ───────────────────────────────────────────────────────────── */
.bve-form-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--bve-blue, #0077b6);
    flex-wrap: wrap;
}

.bve-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bve-text);
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.bve-tab-btn:hover {
    color: var(--bve-blue, #0077b6);
}

.bve-tab-btn.active {
    color: var(--bve-navy, #001f3a);
    border-bottom-color: var(--bve-navy, #001f3a);
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.bve-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bve-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bve-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bve-navy, #001f3a);
}

.bve-field input[type="text"],
.bve-field input[type="email"],
.bve-field input[type="tel"],
.bve-field input[type="number"],
.bve-field textarea,
.bve-field select {
    border: 1px solid #d0dde8;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--bve-navy, #001f3a);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.bve-field select {
    min-height: 42px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%230077b6'><path d='M6 8 0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px 7px;
    padding-right: 2rem;
}

.bve-field input:focus,
.bve-field textarea:focus,
.bve-field select:focus {
    border-color: var(--bve-blue, #0077b6);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.bve-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .bve-field-row {
        grid-template-columns: 1fr;
    }
}

/* Datenschutz / consent checkbox — keep checkbox + text on one flex row. */
.bve-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    font-weight: 400;
    cursor: pointer;
    color: var(--bve-navy, #001f3a);
}

.bve-checkbox-label > span {
    flex: 1;
    min-width: 0;
}

.bve-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
    margin-top: 0.15rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--bve-blue, #0077b6);
}

/* ── Participant fields ───────────────────────────────────────────────────── */
.bve-tn-felder {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-left: 3px solid var(--bve-blue-light, #4db8e8);
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.bve-tn-felder label {
    font-size: 0.88rem;
    color: var(--bve-text);
    font-weight: 600;
}

.bve-tn-felder input {
    border: 1px solid #c0d4e4;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    color: var(--bve-navy, #001f3a);
}

/* ── Submit & messages ───────────────────────────────────────────────────── */
.bve-submit-btn {
    margin-top: 0.5rem;
    align-self: flex-start;
}

.bve-form-error {
    color: #c0392b;
    font-size: 0.9rem;
    padding: 0.6rem;
    background: #fdf3f2;
    border-radius: 4px;
    border-left: 3px solid #c0392b;
}

.bve-success-msg {
    color: #155724;
    font-size: 1rem;
    padding: 1rem;
    background: #d4edda;
    border-radius: 4px;
    border-left: 4px solid #28a745;
    margin-bottom: 1rem;
    font-weight: 600;
}
