/*
 * Integrations page — PedalPro house style.
 * Scope: .crm-integrations (added to the root div in integrations.blade.php).
 * See docs/24-layout.md for the token values.
 */

.crm-integrations {
    --surface:         #ffffff;
    --surface-2:       #f7f9fd;
    --border:          #e1e8f5;
    --text:            #0a1230;
    --text-dim:        #66738f;
    --text-muted:      #9dafc8;
    --accent:          #2563eb;
    --accent-soft:     #eaf0fe;
    --accent-ink:      #1d3fb0;
    --ok:              #10b981;
    --ok-soft:         #d1fae5;
    --warn:            #f59e0b;
    --warn-soft:       #fef3c7;
    --danger:          #ef4444;
    --danger-soft:     #fee2e2;
}

.dark .crm-integrations {
    --surface:         #0f1a3d;
    --surface-2:       #16224a;
    --border:          #24305a;
    --text:            #e8ecf7;
    --text-dim:        #a3adc7;
    --text-muted:      #5b6a8c;
    --accent:          #3b82f6;
    --accent-soft:     rgba(37, 99, 235, 0.22);
    --accent-ink:      #60a5fa;
    --ok:              #34d399;
    --ok-soft:         rgba(16, 185, 129, 0.15);
    --warn:            #fbbf24;
    --warn-soft:       rgba(245, 158, 11, 0.15);
    --danger:          #f87171;
    --danger-soft:     rgba(239, 68, 68, 0.15);
}

/* ── Card ──────────────────────────────────────────────────────────────── */

.int-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
}

.int-card-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.int-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.375rem;
}

.int-card-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
}

.int-card-desc {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    margin: 0;
}

/* ── Status badge ──────────────────────────────────────────────────────── */

.int-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.int-badge--ok,
.int-badge--enabled {
    background: var(--ok-soft);
    color: var(--ok);
}

.int-badge--warning {
    background: var(--warn-soft);
    color: var(--warn);
}

.int-badge--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.int-badge--disabled {
    background: var(--surface-2);
    color: var(--text-muted);
}

/* "set" badge on a label */
.int-set-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--ok-soft);
    color: var(--ok);
    margin-left: 4px;
    vertical-align: 1px;
}

/* ── Form ──────────────────────────────────────────────────────────────── */

.int-form {
    padding: 1.25rem 1.5rem;
}

.int-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem 1.25rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .int-form-grid {
        grid-template-columns: 1fr;
    }
}

.int-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.int-field--span2 {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .int-field--span2 {
        grid-column: span 1;
    }
}

.int-field--checkbox {
    justify-content: flex-end;
    padding-bottom: 0.25rem;
}

.int-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.int-input,
.int-select {
    font-size: 13px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.int-input:focus,
.int-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: var(--surface);
}

.int-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.int-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

.int-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.int-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ── Actions ───────────────────────────────────────────────────────────── */

.int-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.int-btn-primary {
    padding: 0.5rem 1.25rem;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    transition: opacity 0.15s;
}

.int-btn-primary:hover {
    opacity: 0.88;
}

.int-btn-ghost {
    padding: 0.5rem 1.25rem;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    background: transparent;
    color: var(--text-dim);
    border: 2px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}

.int-btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.int-hint-block {
    margin-top: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 12px;
    font-weight: 500;
}
