/**
 * Klub Verteiler Manager – Frontend-Styles
 */

/* ─── Grundlayout ─────────────────────────────── */
.kvm {
	font-family: inherit;
	line-height: 1.6;
}

.kvm-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.kvm-header h2 {
	margin: 0;
}

/* ─── Buttons ─────────────────────────────────── */
.kvm .kvm-btn,
.kvm-btn {
	display: inline-block;
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.15s ease;
	background: #6c757d;
	color: #fff;
	line-height: 1.4;
	box-sizing: border-box;
}

.kvm .kvm-btn:hover,
.kvm-btn:hover {
	opacity: 0.85;
	color: #fff;
	text-decoration: none;
}

.kvm .kvm-btn--primary,
.kvm-btn--primary {
	background: #1565c0 !important;
	color: #fff !important;
}

.kvm .kvm-btn--secondary,
.kvm-btn--secondary {
	background: #546e7a !important;
	color: #fff !important;
}

.kvm .kvm-btn--danger,
.kvm-btn--danger {
	background: #c62828 !important;
	color: #fff !important;
}

.kvm .kvm-btn--small,
.kvm-btn--small {
	padding: 5px 12px;
	font-size: 13px;
}

/* ─── Notices ─────────────────────────────────── */
.kvm-notice {
	padding: 12px 16px;
	border-radius: 4px;
	margin: 12px 0;
	font-size: 14px;
}

.kvm-notice--success {
	background: #e8f5e9;
	color: #2e7d32;
	border: 1px solid #a5d6a7;
}

.kvm-notice--error {
	background: #ffebee;
	color: #c62828;
	border: 1px solid #ef9a9a;
}

.kvm-notice--info {
	background: #e3f2fd;
	color: #1565c0;
	border: 1px solid #90caf9;
}

/* ─── Formular ────────────────────────────────── */
.kvm-form-card {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 24px;
	margin-bottom: 24px;
}

.kvm-form-card h3 {
	margin-top: 0;
}

.kvm-field {
	margin-bottom: 16px;
}

.kvm-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 14px;
}

.kvm-input {
	width: 100%;
	max-width: 480px;
	padding: 8px 12px;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 15px;
	box-sizing: border-box;
}

.kvm-input:focus {
	outline: none;
	border-color: #1565c0;
	box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

.kvm-fieldset {
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 12px 16px;
	margin: 0 0 16px 0;
}

.kvm-fieldset legend {
	font-weight: 600;
	font-size: 14px;
	padding: 0 6px;
}

.kvm-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	cursor: pointer;
	font-size: 14px;
}

.kvm-form-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 20px;
}

/* ─── Kontakttabelle ──────────────────────────── */
.kvm-contacts-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 16px;
	font-size: 14px;
}

.kvm-contacts-table th {
	background: #f0f4f8;
	text-align: left;
	padding: 10px 12px;
	border-bottom: 2px solid #dee2e6;
	font-size: 13px;
	color: #555;
}

.kvm-contacts-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.kvm-contacts-table tbody tr:hover {
	background: #f8f9fa;
}

.kvm-row-actions {
	white-space: nowrap;
}

.kvm-row-actions .kvm-btn {
	margin-right: 6px;
}

.kvm-check {
	font-size: 16px;
}

.kvm-dash {
	color: #aaa;
}

/* ─── Kontaktkarten (kvm_list) ────────────────── */
.kvm-contact-cards {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}

.kvm-contact-card {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kvm-contact-card strong {
	font-size: 15px;
}

.kvm-contact-card a {
	font-size: 13px;
	color: #1565c0;
	word-break: break-all;
}

.kvm-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

.kvm-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
}

.kvm-tag--board   { background: #e3f2fd; color: #1565c0; }
.kvm-tag--sports  { background: #e8f5e9; color: #2e7d32; }
.kvm-tag--other   { background: #fff3e0; color: #e65100; }

/* ─── Leerstand ───────────────────────────────── */
.kvm-empty-state {
	padding: 24px;
	text-align: center;
	color: #888;
	font-style: italic;
	background: #f8f9fa;
	border: 1px dashed #dee2e6;
	border-radius: 4px;
}

/* ─── Bestätigungsseite ───────────────────────── */
.kvm-confirmation-success {
	text-align: center;
	padding: 40px;
	background: #e8f5e9;
	border: 1px solid #a5d6a7;
	border-radius: 6px;
}

.kvm-confirmation-icon {
	font-size: 48px;
	display: block;
	margin-bottom: 12px;
}

/* ─── Responsive ──────────────────────────────── */

/* Tablet: ≤ 900px – Inputs und Buttons volle Breite */
@media (max-width: 900px) {
	.kvm-input {
		max-width: 100%;
	}
}

/* Smartphone / kleines Tablet: ≤ 768px – Tabelle → Karten */
@media (max-width: 768px) {
	.kvm-header {
		flex-direction: column;
		align-items: stretch;
	}

	.kvm-header .kvm-btn {
		width: 100%;
		text-align: center;
	}

	/* Formular */
	.kvm-form-card {
		padding: 16px;
	}

	/* iOS: Eingabefelder ≥ 16px verhindern Auto-Zoom */
	.kvm-input {
		font-size: 16px;
	}

	.kvm-form-actions {
		flex-direction: column;
	}

	.kvm-form-actions .kvm-btn {
		width: 100%;
		text-align: center;
		min-height: 48px;
	}

	/* Tabelle → Kartenlayout */
	.kvm-contacts-table thead {
		display: none;
	}

	.kvm-contacts-table,
	.kvm-contacts-table tbody,
	.kvm-contacts-table tr,
	.kvm-contacts-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.kvm-contacts-table tr {
		background: #fff;
		border: 1px solid #dee2e6;
		border-radius: 8px;
		margin-bottom: 16px;
		overflow: hidden;
		padding: 0;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	}

	.kvm-contacts-table td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 11px 14px;
		border-bottom: 1px solid #f0f0f0;
		min-height: 44px;
		gap: 8px;
	}

	.kvm-contacts-table td:last-child {
		border-bottom: none;
	}

	.kvm-contacts-table td::before {
		content: attr(data-label);
		font-weight: 600;
		font-size: 13px;
		color: #666;
		flex: 0 0 90px;
	}

	/* Aktions-Zelle: Buttons nebeneinander, grauer Hintergrund */
	.kvm-contacts-table td.kvm-row-actions {
		background: #f8f9fa;
		padding: 10px 14px;
		gap: 8px;
		justify-content: flex-end;
	}

	.kvm-contacts-table td.kvm-row-actions::before {
		display: none;
	}

	.kvm-contacts-table td.kvm-row-actions .kvm-btn {
		flex: 1;
		text-align: center;
		min-height: 44px;
		padding: 10px 8px;
		font-size: 14px;
	}
}

/* ─── Login-Formular ──────────────────────────── */
.kvm-login-wrap {
	display: flex;
	justify-content: center;
	padding: 32px 16px;
}

.kvm-login-box {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 36px 40px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.kvm-login-header {
	text-align: center;
	margin-bottom: 24px;
}

.kvm-login-icon {
	font-size: 32px;
	display: block;
	margin-bottom: 8px;
}

.kvm-login-header h2 {
	margin: 0 0 6px;
	font-size: 22px;
	color: #1e3a5f;
}

.kvm-login-subtitle {
	margin: 0;
	font-size: 14px;
	color: #666;
}

/* WordPress-Formular-Felder überschreiben */
#kvm-loginform p {
	margin-bottom: 16px;
}

#kvm-loginform label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 4px;
	color: #333;
}

#kvm-loginform input[type="text"],
#kvm-loginform input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color 0.15s ease;
}

#kvm-loginform input[type="text"]:focus,
#kvm-loginform input[type="password"]:focus {
	outline: none;
	border-color: #1565c0;
	box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

#kvm-loginform .login-remember label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	font-size: 14px;
	cursor: pointer;
}

#kvm-loginform .login-submit {
	margin-top: 20px;
}

#kvm-loginform #wp-submit {
	width: 100%;
	padding: 12px;
	background: #1565c0;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

#kvm-loginform #wp-submit:hover {
	background: #0d47a1;
}

.kvm-login-footer {
	text-align: center;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.kvm-login-lost-pw {
	font-size: 13px;
	color: #666;
	text-decoration: none;
}

.kvm-login-lost-pw:hover {
	color: #1565c0;
	text-decoration: underline;
}

@media (max-width: 480px) {
	.kvm-login-box {
		padding: 24px 20px;
	}
}
