/* Apply height: 100% to all direct children of the form element */
form > * {
    height: 100%;
}

/* Tall line-height only for repeatable group +/- buttons */
.repeatable > .col > .btn-secondary,
.repeatable > .row > .col > .btn-secondary {
    line-height: 44px;
}

/* Styled file upload button */
.file-input-styled {
    cursor: pointer;
}

.file-input-styled::file-selector-button {
    background-color: var(--bs-secondary);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: background-color 0.15s ease-in-out;
}

.file-input-styled::file-selector-button:hover {
    background-color: var(--bs-secondary);
    filter: brightness(0.85);
}

/* Remove bottom margin from the last row inside a repeatable vertical entry
   so the - button aligns flush with the content */
.repeatable > .row.align-items-stretch > .col > .group-container > :last-child,
.repeatable
    > .row.align-items-stretch
    > .col
    > .group-container
    > :last-child
    .mb-2 {
    margin-bottom: 0 !important;
}

/* Show placeholder text when a floating-label input is focused */
.form-floating > .form-control:focus::placeholder {
    color: var(--bs-secondary-color);
}

/* Shaded background for nested form groups (not the top-level group) */
.group-container:not(.form-top) {
    background: var(--bs-tertiary-bg);
    border-radius: 6px;
    padding: 1rem;
}

/* Remove padding from deeper-nested group containers to prevent increasing indent */
.group-container:not(.form-top) .group-container:not(.form-top) {
    padding: 0;
    background: transparent;
    border-radius: 0;
}

/* Replace the <hr> separator with spacing — the background provides separation */
.group-container:not(.form-top) > hr {
    display: none;
}

/* Keep the top-level <hr> but style it subtly */
.group-container.form-top > hr {
    opacity: 0.25;
}

/* Collapsible section styling */
.collapsible-section {
    padding: 0;
}

.collapsible-section > summary {
    cursor: pointer;
    padding: 0.5rem 1rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    user-select: none;
    background-color: var(--bs-secondary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: filter 0.15s ease-in-out;
}

.collapsible-section > summary:hover {
    filter: brightness(0.85);
}

.collapsible-section > summary::-webkit-details-marker {
    display: none;
}

.collapsible-section > summary::after {
    content: "\25BC";
    font-size: 0.65em;
    transition: transform 0.2s ease;
}

.collapsible-section[open] > summary::after {
    transform: rotate(180deg);
}

.collapsible-section > .collapsible-content {
    padding: 1rem 0 0;
}
