/* ============================================================
   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; }
}

/* ============================================================
   VentoryOne API card — MCP connector (brand: #00629E)
   ============================================================ */
/* --- segmented tabs (API Token / MCP Connector) --- */
.vo-api-tabs {
    display: inline-flex; gap: 4px;
    background: #f2f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}
.vo-api-tab {
    border: none; background: none;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: .9rem; font-weight: 600; color: #64748b;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.vo-api-tab:hover { color: #1f2937; }
.vo-api-tab.is-active {
    background: #fff;
    color: var(--primary, #00629E);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

.vo-api-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
/* Inherit the global .btn radius (.35rem) so these match the Save button. */
.vo-api-actions .btn { font-weight: 600; }

.mcp-reveal { margin-top: 14px; font-weight: 600; }

.vo-token-status {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .85rem; font-weight: 600; color: #6b7280;
}
.vo-token-status .vo-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #cbd5e1;
}
.vo-token-status.is-active { color: #1f2937; }
.vo-token-status.is-active .vo-dot { background: #1cc88a; }

.vo-token-copy .vo-copy-link {
    border: none; background: none; padding: 0;
    color: var(--primary, #00629E); font-size: .85rem; font-weight: 600; cursor: pointer;
}

.vo-api-divider { border: 0; border-top: 1px solid #eef0f4; margin: 22px 0; }

/* --- MCP sub-section --- */
.mcp-connect__head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.mcp-connect__icon { width: 44px; height: 44px; font-size: 1rem; }
.mcp-connect__heading { flex: 1 1 auto; min-width: 0; }
.mcp-connect__title { font-weight: 700; font-size: 1rem; color: #1f2937; margin: 4px 0 4px; }
.mcp-connect__desc { color: #6b7280; font-size: .88rem; line-height: 1.5; margin: 0; }

.mcp-url {
    display: flex; align-items: center; gap: 12px;
    background: #f7f9fc;
    border: 1px solid #e6eaf2;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.mcp-url__icon { color: #9aa4b2; flex: 0 0 auto; }
.mcp-url__value {
    flex: 1 1 auto; min-width: 0;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .9rem; color: #334155;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mcp-url__value.is-placeholder {
    font-family: inherit; color: #9aa4b2; font-style: italic;
}
.mcp-url__copy {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #dbe1ec; border-radius: 9px;
    background: #fff; color: var(--primary, #00629E); cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.mcp-url__copy:hover:not(:disabled) { background: rgba(0, 98, 158, .06); border-color: rgba(0, 98, 158, .35); }
.mcp-url__copy:disabled { color: #c2cad6; cursor: not-allowed; }

.mcp-note {
    display: flex; gap: 10px;
    background: rgba(0, 98, 158, .06);
    border-radius: 12px;
    padding: 12px 14px;
    color: #3f5165; font-size: .85rem; line-height: 1.5;
}
.mcp-note__icon { color: var(--primary, #00629E); flex: 0 0 auto; margin-top: 2px; }
