form#estimation_form {
    margin: 1px auto;
    padding: 15px 20px;
    background: #f4f7f8;
}

/* Visually lock the form after preview — submit button is hidden, but we
   also block hover/click/typing so the values used for the preview can't
   drift before the user clicks "Ausgewählte zuschicken". */
form#estimation_form.is-locked {
    pointer-events: none;
    opacity: 0.65;
}

form#estimation_form fieldset {
    margin-bottom: 30px;
    border: none;
}

form#estimation_form fieldset:not(:last-of-type) {
    border-bottom: 1px solid #f3a719;
}

form#estimation_form fieldset > .fieldset-heading {
    font-weight: 600;
    margin-bottom: 40px;
    margin-top: 0;
}

form#estimation_form .notice p {
    font-weight: 500;
    color: red;
}

fieldset.building_parameters .path-container > div,
fieldset.estimation_parameters .estimation_parameters_content,
fieldset.estimation_parameters .tg-container:not(.initially),
fieldset.building_parameters .hidden,
fieldset.estimation_parameters .hidden,
.submit-container.hidden {
    display: none;
}

.building_parameters  > div,
.building_parameters .path-container > div,
fieldset.estimation_parameters .field-unit-wrapper,
fieldset.estimation_parameters .estimation_parameters_content > div{
    position: relative;
}

fieldset.estimation_parameters .field-unit-wrapper span.unit {
    position: absolute;
    right: 22px;
    top: 10px;
    color: darkgray;
}

.submit-container > .consent {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.submit-container > .consent {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.submit-container > .consent label input{
    height: initial;
    width: initial;
}

fieldset .more-info,
fieldset .more-info {
    position: absolute;
    z-index: 100;
    display: none;
    padding: 10px 25px 10px 10px;
    left: 5px;
    top: 27px;
    width: 90%;
    border: 1px solid lightgray;
    background-color: white;
    box-shadow: 5px 3px 5px gray;
}

fieldset .more-info a {
    color: blue;
}

fieldset .more-info > span.close {
    position: absolute;
    color: #f3a719;
    right: 5px;
    top: 5px;
    cursor: pointer;
}

.la-question-circle {
    cursor: help;
}

/* ===== Offer cards (Dado-style preview) ===== */

.estimation-offers-block {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(95vw, 1100px);
    margin: 30px 0;
}

.estimation-offers-block.hidden {
    display: none;
}

.estimation-offers-block .estimation-result-message {
    background: #fff8e8;
    border: 1px solid #f3a719;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.estimation-offers-block .estimation-result-message p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.offer-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 900px) {
    .offer-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .offer-cards { grid-template-columns: 1fr; }
}

.offer-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s ease, outline-color 0.18s ease;
    outline: 2px solid transparent;
}

.offer-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.offer-card.is-selected {
    outline-color: #f3a719;
    box-shadow: 0 8px 20px rgba(243, 167, 25, 0.25);
}

.offer-card .offer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    min-width: 0;
}

.offer-card .offer-logo {
    height: 40px;
    width: 80px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff8e8;
    border-radius: 6px;
    padding: 4px;
}

.offer-card .offer-name {
    font-weight: 700;
    color: #2b2b2b;
    font-size: 14px;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
    word-break: normal;
    overflow-wrap: break-word;
}

.offer-card .offer-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.offer-card .offer-price {
    font-size: 20px;
    font-weight: 700;
    color: #f3a719;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
    word-break: normal;
    overflow-wrap: break-word;
}

.offer-card .offer-select {
    flex-shrink: 0;
}

.offer-card .offer-select {
    background: transparent;
    border: none;
    padding: 0;
    color: #b9b9b9;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    position: relative;
}

.offer-card .offer-select:hover {
    color: #888;
    background: rgba(0, 0, 0, 0.04);
}

.offer-card .offer-select:active {
    transform: scale(0.95);
}

.offer-card .offer-select-icon {
    font-size: 28px;
    line-height: 1;
}

.offer-card .offer-select-icon-on { display: none; }
.offer-card.is-selected .offer-select { color: #2e9a4e; background: rgba(46, 154, 78, 0.10); }
.offer-card.is-selected .offer-select-icon-off { display: none; }
.offer-card.is-selected .offer-select-icon-on { display: inline-block; }

.offer-card .offer-meta {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offer-card .offer-meta > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    word-break: normal;
}

.offer-card .offer-meta dt,
.offer-card .offer-meta dd {
    word-break: normal;
}

.offer-card .offer-meta > div:last-child {
    border-bottom: none;
}

.offer-card .offer-meta dt {
    color: #777;
    margin: 0;
}

.offer-card .offer-meta dd {
    color: #2b2b2b;
    margin: 0;
    font-weight: 500;
}

/* Accordion details panel inside each card */

.offer-details-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.25s ease, opacity 0.18s ease, margin-top 0.25s ease;
}

.offer-card.is-expanded .offer-details-panel {
    max-height: 500px;
    opacity: 1;
    margin-top: 14px;
}

.offer-details-list {
    list-style: none;
    padding: 14px 0 0 0;
    margin: 0;
    border-top: 1px dashed #e4e4e4;
}

.offer-detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f3f3;
    font-size: 13px;
}

.offer-detail-row:last-child { border-bottom: none; }

.offer-detail-row dt {
    color: #888;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.offer-detail-row dt i {
    color: #f3a719;
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.offer-detail-row dd {
    color: #2b2b2b;
    margin: 0;
    font-weight: 500;
    text-align: right;
    word-break: normal;
    overflow-wrap: break-word;
    min-width: 0;
}

/* Toggle button (chevron) at bottom of the card */
.offer-toggle-details {
    align-self: stretch;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #eee;
    background: #fafafa;
    color: #555;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.offer-toggle-details:hover {
    background: #fff5e0;
    border-color: #f3a719;
    color: #f3a719;
}

.offer-toggle-details:focus-visible {
    outline: 2px solid #f3a719;
    outline-offset: 2px;
}

.offer-toggle-chevron {
    transition: transform 0.2s ease;
}

.offer-card.is-expanded .offer-toggle-chevron {
    transform: rotate(180deg);
}

.offer-card .offer-toggle-label-less { display: none; }
.offer-card.is-expanded .offer-toggle-label-more { display: none; }
.offer-card.is-expanded .offer-toggle-label-less { display: inline; }

@media (prefers-reduced-motion: reduce) {
    .offer-details-panel,
    .offer-toggle-chevron,
    .offer-card {
        transition: none;
    }
}

.offer-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.offer-actions button {
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    width: auto;
    flex: 0 0 auto;
    text-transform: none;
    line-height: 1.2;
    transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.offer-actions .offer-send-btn {
    background: #f3a719;
    color: #fff;
}

.offer-actions .offer-send-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.offer-actions .offer-send-btn:not(:disabled):hover {
    background: #d99213;
}

.offer-actions .offer-close-btn {
    background: #f4f7f8;
    color: #555;
    border: 1px solid #ddd;
}

.offer-actions .offer-close-btn:hover {
    background: #eef1f2;
}

.offer-status {
    margin-top: 14px;
    color: #555;
    text-align: right;
    min-height: 1.5em;
}

.spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: estimation-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes estimation-spin {
    to { transform: rotate(360deg); }
}

.estimation-offers-block .estimation-error {
    background: #fdecea;
    border: 1px solid #d94545;
    color: #b32a2a;
    padding: 14px 18px;
    border-radius: 8px;
}

.estimation-offers-block .estimation-error p { margin: 4px 0; }