:root {
    --bg: #ece7dd;
    --text: #2a2a2a;
    --muted: #8a8a8a;
    --line: #c8c4ba;
}
#form{
    background-color: var(--beige);
    margin-top: 60px;
    overflow: hidden;
}
.freude-form {
    max-width: 820px;
    margin: 0 auto;
    padding: 4rem 2rem;
    color: var(--text);
    box-sizing: border-box;
}

.form-title {
    text-align: center;
    margin: 0 0 4rem;
    font-weight: 400;
}

/* Rows & dividers */
.form-row {
    padding: 1rem 0;
}

.divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 1.5rem 0;
}

/* Custom checkbox */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid var(--text);
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--text);
}

/* Gutschein row */
.gutschein-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
}

/* Range slider */
#gutschein-range {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 1px;
    background: var(--text);
    cursor: pointer;
}

#gutschein-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
    border: none;
}

#gutschein-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
    border: none;
}

/* Books */
.section-headline {
    margin: 0 0 1.5rem;
}

.book-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.book-item .price {
    color: var(--muted);
    margin-left: 0.5rem;
}

.widmung-row {
    margin-left: 2rem;
    margin-bottom: 12px;
    /* margin-top removed — handled by the parent's gap */
}

.widmung-text {
    border: none;
    border-bottom: 1px solid var(--text);
    background: transparent;
    width: 280px;
    padding: 2px 4px;
    font: inherit;
    color: var(--text);
}

/* Summe + Button */
.summe {
    text-align: right;
    margin: 2rem 0 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-label input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.2em;
}

.btn-bestellen {
    padding: 0.75rem 2.5rem;
    border: 1px solid var(--text);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-bestellen:hover {
    background: var(--text);
    color: var(--bg);
}

/* Disabled Widmung state — when the book isn't selected */
.checkbox-label input[type="checkbox"]:disabled {
    border-color: var(--muted);
    cursor: not-allowed;
}

.widmung-text:disabled {
    border-bottom-color: var(--muted);
    color: var(--muted);
    cursor: not-allowed;
}

.widmung-row:has(:disabled) {
    color: var(--muted);
    cursor: not-allowed;
}

#ckeckout{
    display: flex;
    flex-direction: row;
    align-items: start;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .freude-form {
        padding: 2rem 24px;
    }
    .gutschein-row {
        gap: 1rem;
    }
    .widmung-text {
        width: 100%;
        box-sizing: border-box;
    }
    .widmung-row {
        margin-left: 0;
    }
    #ckeckout{
        flex-direction: column;
        align-items: end;
    }
}