/**
 * CF7 Mate — styling for the "CF7 Mate" tab inside the CF7 form editor.
 *
 * Each feature (Responses, Email Routing, Redirect after submission, …) is
 * a self-contained card with a clear header, an optional description, and
 * its body. Cards are separated by a subtle gutter, not just a stacked
 * fieldset border.
 *
 * @package CF7_Mate
 * @since 3.1.0
 */

/* ── Panel wrapper ─────────────────────────────────────────── */
.cf7m-panel-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 880px;
	margin: 16px 0 24px;
}

.cf7m-panel-wrap > h2 {
	font-size: 18px;
	font-weight: 600;
	color: #1d2327;
	margin: 0;
	padding: 0;
	letter-spacing: -0.005em;
}

/* ── Feature card ──────────────────────────────────────────── */
.cf7m-feat {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 0;
	margin: 0;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cf7m-feat__header {
	padding: 16px 20px 12px;
	border-bottom: 1px solid #f1f5f9;
}

.cf7m-feat__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	margin: 0 0 4px;
}

.cf7m-feat__title .cf7m-feat__badge {
	display: inline-flex;
	align-items: center;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 999px;
	background: #eef1ff;
	color: #3044d7;
}

.cf7m-feat__desc {
	margin: 0;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.5;
}

.cf7m-feat__body {
	padding: 16px 20px 20px;
}

.cf7m-feat__body > :first-child {
	margin-top: 0;
}
.cf7m-feat__body > :last-child {
	margin-bottom: 0;
}

/* Sub-section inside a feature (e.g. Conditional redirects). */
.cf7m-feat__sub {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid #f1f5f9;
}

.cf7m-feat__sub-title {
	font-size: 13px;
	font-weight: 600;
	color: #111827;
	margin: 0 0 4px;
}

.cf7m-feat__sub-desc {
	margin: 0 0 12px;
	font-size: 12.5px;
	color: #6b7280;
	line-height: 1.5;
}

/* ── Consistent labeled rows (alternative to .form-table) ──── */
.cf7m-feat-row {
	display: grid;
	grid-template-columns: 180px minmax(0, 1fr);
	gap: 12px 18px;
	align-items: start;
	padding: 10px 0;
}

.cf7m-feat-row + .cf7m-feat-row {
	border-top: 1px dashed #f1f5f9;
}

.cf7m-feat-row__label {
	font-size: 13px;
	font-weight: 500;
	color: #1f2937;
	padding-top: 6px;
}

.cf7m-feat-row__control {
	min-width: 0;
}

.cf7m-feat-row__control .description,
.cf7m-feat-row__control .cf7m-feat-row__hint {
	margin: 6px 0 0;
	font-size: 12.5px;
	color: #6b7280;
	line-height: 1.5;
}

.cf7m-feat-row__control input[type="text"],
.cf7m-feat-row__control input[type="url"],
.cf7m-feat-row__control input[type="number"],
.cf7m-feat-row__control select {
	min-height: 32px;
}

.cf7m-feat-row__control input[type="text"].regular-text,
.cf7m-feat-row__control input[type="url"].regular-text {
	width: 100%;
	max-width: 480px;
}

/* ── Existing .form-table inside a feature: tighten ───────── */
.cf7m-feat .form-table {
	margin: 0;
}
.cf7m-feat .form-table th {
	padding: 12px 12px 12px 0;
	width: 180px;
	font-size: 13px;
	font-weight: 500;
	color: #1f2937;
}
.cf7m-feat .form-table td {
	padding: 12px 0;
	font-size: 13px;
	color: #1f2937;
}
.cf7m-feat .form-table .description {
	margin-top: 6px;
	color: #6b7280;
}

/* ── Rule tables (Email Routing, Conditional Redirects) ────── */
.cf7m-feat .widefat {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: none;
}
.cf7m-feat .widefat thead th {
	background: #f8fafc;
	border-bottom: 1px solid #e5e7eb;
	font-size: 11.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #475569;
	padding: 8px 10px;
}
.cf7m-feat .widefat tbody td {
	padding: 8px 10px;
	border-top: 1px solid #f1f5f9;
	vertical-align: middle;
}
.cf7m-feat .widefat input[type="text"] {
	width: 100%;
	min-height: 30px;
}
.cf7m-feat .widefat select {
	min-height: 30px;
}
.cf7m-feat .widefat .button {
	padding: 2px 10px;
	min-height: 28px;
	line-height: 1.6;
}

/* Empty-state row inside a rules table. */
.cf7m-feat .widefat tbody:empty + tfoot,
.cf7m-feat .widefat tbody.is-empty {
	color: #94a3b8;
}

.cf7m-feat .cf7m-add-rule-btn,
.cf7m-feat .button.cf7m-add-rule-btn,
.cf7m-feat #cf7m-add-rule,
.cf7m-feat #cf7m-add-redirect-rule {
	margin-top: 10px;
}

/* ── Inline checkbox row ───────────────────────────────────── */
.cf7m-feat-check {
	display: inline-flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	color: #1f2937;
	cursor: pointer;
}
.cf7m-feat-check input[type="checkbox"] {
	margin: 2px 0 0;
}
