/* ============================================================
   Reusable settings-card component
   Drop <div class="settings-card"> ... </div> into any form.
   Optionally wrap a group of cards in <div class="settings-cards">.
   Header chrome (icon + title + description) lives in the
   components/settings_card_header.html partial.
   ============================================================ */

.settings-cards { width: 100%; }

.settings-card {
    position: relative;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(16, 24, 40, .05);
    padding: 26px 28px;
    margin-bottom: 22px;
    transition: box-shadow .2s ease;
}
.settings-card:hover { box-shadow: 0 8px 26px rgba(16, 24, 40, .09); }

/* --- header: icon chip + title + description --- */
.settings-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}
.settings-card__icon {
    flex: 0 0 auto;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: rgba(0, 98, 158, .08);
    color: var(--primary);
    font-size: 1.15rem;
}
.settings-card__logo {
    flex: 0 0 auto;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
}
.settings-card__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.settings-card__heading { flex: 1 1 auto; min-width: 0; }
.settings-card__title {
    font-weight: 700;
    font-size: 1.12rem;
    color: #1f2937;
    margin: 4px 0 6px;
}
.settings-card__desc {
    color: #6b7280;
    font-size: .9rem;
    line-height: 1.5;
    margin-bottom: 0;
}
.settings-card__desc .hint { color: #9ca3af; font-style: italic; }

/* --- optional top-right control (e.g. a toggle switch) --- */
.settings-card__toggle { position: absolute; top: 26px; right: 28px; }

/* --- inputs ---
   Field/option/button styling applies inside a .settings-card (full shell)
   OR a bare .settings-form (e.g. a modal body that shouldn't get the card
   chrome, to avoid a box-in-a-box). */
.settings-card__label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: #374151;
    margin-bottom: 6px;
}
/* Target real editable inputs only. Exclude the .form-control elements that
   crispy/bootstrap use as layout containers for file widgets (ClearableFileInput
   renders `.form-control.d-flex` and `.form-control.custom-file` inside an
   .input-group) — restyling those breaks the input-group's flush corners. */
.settings-card .form-control:not(.custom-file):not(.d-flex):not([type="file"]),
.settings-form .form-control:not(.custom-file):not(.d-flex):not([type="file"]) {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #d8dee9;
    padding: .6rem .85rem;
}
.settings-card .form-control:not(.custom-file):not(.d-flex):not([type="file"]):focus,
.settings-form .form-control:not(.custom-file):not(.d-flex):not([type="file"]):focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 98, 158, .12);
}

/* --- radio / checkbox option rows --- */
.settings-card .form-check,
.settings-form .form-check {
    position: relative;
    padding: .7rem .9rem .7rem 2.4rem;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: border-color .15s ease, background .15s ease;
}
/* make the whole bordered row clickable, not just the radio/label */
.settings-card .form-check .form-check-label,
.settings-form .form-check .form-check-label { cursor: pointer; }
.settings-card .form-check .form-check-label::after,
.settings-form .form-check .form-check-label::after { content: ""; position: absolute; inset: 0; }
.settings-card .form-check:hover,
.settings-form .form-check:hover { border-color: rgba(0, 98, 158, .35); background: #f5fafd; }
.settings-card .form-check:has(.form-check-input:checked),
.settings-form .form-check:has(.form-check-input:checked) { border-color: var(--primary); background: rgba(0, 98, 158, .05); }
.settings-card .form-check-input,
.settings-form .form-check-input { margin-top: .3rem; accent-color: var(--primary); }
.settings-card .badge-secondary,
.settings-form .badge-secondary { background: rgba(0, 98, 158, .08); color: var(--primary); font-weight: 700; }

@media (max-width: 575.98px) {
    .settings-card { padding: 20px; }
    .settings-card__toggle { position: static; display: inline-block; margin-bottom: 12px; }
}
