/**
 * TBG Capaciteit-keuzehulp v8.5.8
 *
 * Bovenop tbg-tools.css. Implementeert dezelfde option-card stijl als de quiz
 * (.tbg-quiz__opt patroon) onder een eigen namespace .tbg-cap__*.
 */

/* ============================================================
 * OPTIONS — identieke stijl aan tbg-quiz__opt
 * ============================================================ */

.tbg-cap__step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tbg-cap__step--active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tbg-cap__options {
    display: grid;
    gap: 10px;
}

.tbg-cap__options--grid {
    grid-template-columns: 1fr 1fr;
}

.tbg-cap__options--3 {
    grid-template-columns: repeat(3, 1fr);
}

.tbg-cap__options--4 {
    grid-template-columns: repeat(4, 1fr);
}

.tbg-cap__opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: white;
    border: 2px solid var(--tbg-border);
    border-radius: var(--tbg-radius-lg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    text-align: left;
    font-family: inherit;
    color: var(--tbg-text);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    box-sizing: border-box;
    font-size: inherit;
    line-height: 1.4;
}

.tbg-cap__opt:hover,
.tbg-cap__opt:focus-visible {
    border-color: var(--tbg-accent);
    background: white;
    color: var(--tbg-text);
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.tbg-cap__opt--selected {
    background: var(--tbg-bg-success);
    border-color: var(--tbg-accent);
}

.tbg-cap__opt--selected:hover,
.tbg-cap__opt--selected:focus-visible {
    background: var(--tbg-bg-success);
    border-color: var(--tbg-accent);
    color: var(--tbg-text);
}

.tbg-cap__opt--compact {
    padding: 12px 14px;
}

.tbg-cap__opt-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--tbg-radius-md);
    background: var(--tbg-bg-soft);
    color: var(--tbg-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbg-cap__opt--selected .tbg-cap__opt-icon {
    background: var(--tbg-bg-success);
    color: var(--tbg-accent);
}

.tbg-cap__opt-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tbg-cap__opt-title {
    font-weight: 700;
    color: var(--tbg-text);
    font-size: 15px;
    line-height: 1.3;
}

.tbg-cap__opt--compact .tbg-cap__opt-title {
    flex: 1;
}

.tbg-cap__opt-desc {
    font-size: 13px;
    color: var(--tbg-text-light);
    line-height: 1.45;
}

.tbg-cap__opt-meta {
    font-size: 11px;
    color: var(--tbg-text-meta);
    margin-top: 2px;
}

.tbg-cap__opt-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--tbg-border-strong);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.15s ease;
}

.tbg-cap__opt-check svg {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.tbg-cap__opt--selected .tbg-cap__opt-check {
    background: var(--tbg-accent);
    border-color: var(--tbg-accent);
}

.tbg-cap__opt--selected .tbg-cap__opt-check svg {
    opacity: 1;
}

/* Mini preset (kWp selector) — geen icon, geen check */
.tbg-cap__opt--mini {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    text-align: center;
}

.tbg-cap__opt--mini .tbg-cap__opt-title {
    font-size: 13px;
}

.tbg-cap__opt--mini .tbg-cap__opt-meta {
    font-size: 11px;
}

.tbg-cap__optional {
    font-weight: 500;
    color: var(--tbg-text-meta);
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
}

/* ============================================================
 * NUMBER INPUT
 * ============================================================ */

.tbg-cap__input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--tbg-border);
    border-radius: var(--tbg-radius-md);
    font-size: 15px;
    font-family: inherit;
    background: white;
    color: var(--tbg-text);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.tbg-cap__input::placeholder {
    color: var(--tbg-text-meta);
}

.tbg-cap__input:hover {
    border-color: var(--tbg-border-strong);
}

.tbg-cap__input:focus {
    outline: none;
    border-color: var(--tbg-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* ============================================================
 * RESULTAAT — uitbreidingen op tbg-tool__result-*
 * ============================================================ */

.tbg-cap__stat-unit {
    font-size: 0.85em;
    color: var(--tbg-text-light);
    font-weight: 600;
}

/* ============================================================
 * BATTERIJEN GRID
 * ============================================================ */

.tbg-cap__batteries {
    margin-top: 20px;
}

.tbg-cap__batteries-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--tbg-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.tbg-cap__batteries-grid {
    display: grid;
    gap: 8px;
}

.tbg-cap__bat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--tbg-border);
    border-radius: var(--tbg-radius-lg);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.tbg-cap__bat-card:hover {
    border-color: var(--tbg-accent);
}

.tbg-cap__bat-img {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--tbg-radius-sm);
    background: var(--tbg-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tbg-cap__bat-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tbg-cap__bat-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tbg-cap__bat-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--tbg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbg-cap__bat-cap {
    font-size: 12px;
    color: var(--tbg-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tbg-cap__bat-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tbg-text-success);
    background: var(--tbg-bg-success);
    border: 1px solid var(--tbg-border-success);
    border-radius: 4px;
    padding: 1px 5px;
}

.tbg-cap__bat-price {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tbg-accent);
}

/* ============================================================
 * ACTIONS & DETAILS
 * ============================================================ */

.tbg-cap__actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tbg-cap__actions .tbg-tool__btn {
    flex: 1;
    min-width: 180px;
    justify-content: center;
    text-decoration: none;
}

.tbg-cap__details {
    margin-top: 20px;
    border-top: 1px solid var(--tbg-border);
    padding-top: 16px;
}

.tbg-cap__details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--tbg-text-light);
    padding: 6px 0;
}

.tbg-cap__details summary:hover {
    color: var(--tbg-accent);
}

.tbg-cap__details ul {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--tbg-text-muted);
    line-height: 1.6;
}

.tbg-cap__details p {
    font-size: 13px;
    color: var(--tbg-text-muted);
    line-height: 1.6;
    margin: 12px 0 8px;
}

/* ============================================================
 * RESPONSIVE
 * ============================================================ */

@media (max-width: 640px) {
    .tbg-cap__options--grid {
        grid-template-columns: 1fr;
    }

    .tbg-cap__options--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tbg-cap__opt {
        padding: 12px 14px;
    }

    .tbg-cap__opt-icon {
        width: 36px;
        height: 36px;
    }

    .tbg-cap__opt-title {
        font-size: 14px;
    }

    .tbg-cap__opt-desc {
        font-size: 12px;
    }

    .tbg-cap__actions {
        flex-direction: column;
    }
}
