.kihd-portaal {
	max-width: 760px;
	margin: 0 auto;
	font-size: .95rem;
	color: var(--kp-text, #222);
}

.kihd-melding {
	padding: .8rem 1.1rem;
	border-radius: var(--kp-radius, 10px);
	margin-bottom: 1.3rem;
	border: 1px solid var(--kp-border, #ddd);
	background: var(--kp-bg-card, #fff);
}
.kihd-melding-fout {
	border-color: var(--kp-accent-strong, #bd1522);
	color: var(--kp-accent-strong, #bd1522);
	background: color-mix(in srgb, var(--kp-accent-strong, #bd1522) 12%, var(--kp-bg-card, #fff));
}
.kihd-melding-ok {
	border-color: #2a8a4a;
	color: #2a8a4a;
	background: color-mix(in srgb, #2a8a4a 12%, var(--kp-bg-card, #fff));
}

.kihd-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	padding-bottom: .8rem;
	border-bottom: 1px solid var(--kp-border, #ddd);
	font-size: .85rem;
	color: var(--kp-text-muted, #666);
}

.kihd-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: var(--kp-primary, #00547e);
	text-decoration: underline;
	cursor: pointer;
	font-size: inherit;
}

/* Navigatie tussen Meldingen/Problems/Changes in het klantportaal — de
 * knoppen (kp-btn) moeten naast elkaar blijven staan, met wat ruimte
 * ertussen en eronder t.o.v. de rest van de content. */
.kihd-portaal-nav {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin-bottom: 1.5rem;
}

.kihd-login-box {
	max-width: 420px;
	margin: 2rem auto;
	padding: 1.6rem;
	border: 1px solid var(--kp-border, #ddd);
	border-radius: var(--kp-radius, 10px);
	background: var(--kp-bg-card, #fff);
}

/* ── Formuliervelden — volgen de light/dark-mode van het thema via de
 * bestaande kp-*-variabelen (--kp-bg-alt, --kp-text, --kp-primary), precies
 * zoals de rest van de site. Geldt voor zowel het klantportaal
 * (login/nieuwe Melding) als het openbare contactformulier, die allebei
 * de klasse "kihd-form" (of, voor inloggen, "kihd-login-box form")
 * gebruiken. Gevulde, vrijwel randloze velden — zie de screenshot die is
 * afgesproken als uitgangspunt: lichte (of, in dark mode, donkere) vlakke
 * achtergrond i.p.v. een dikke gekleurde rand. */

.kihd-form, .kihd-login-box form {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	margin-top: 1rem;
}
.kihd-form label, .kihd-login-box label {
	font-weight: 600;
	margin-top: .6rem;
	color: var(--kp-text, #222);
}

/* Verplicht-sterretje — zelfde accentkleur als de rest van de site
 * (--kp-primary), in plaats van de gewone labelkleur, zodat in één oogopslag
 * duidelijk is welke velden verplicht zijn. */
.kihd-vereist {
	color: var(--kp-primary, #00547e);
	margin-left: .1rem;
}

.kihd-form input[type="text"],
.kihd-form input[type="email"],
.kihd-form input[type="tel"],
.kihd-form input[type="file"],
.kihd-form textarea,
.kihd-form select,
.kihd-login-box input[type="text"],
.kihd-login-box input[type="email"] {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: .85rem 1rem;
	border-radius: calc(var(--kp-radius, 18px) - 8px);
	border: 1px solid transparent;
	background: var(--kp-bg-alt, #e2e8f0);
	color: var(--kp-text, #222);
	-webkit-text-fill-color: var(--kp-text, #222);
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	outline: none;
	font-size: .9rem;
	transition: background 200ms ease, box-shadow 200ms ease;
}
.kihd-form textarea { min-height: 220px; resize: vertical; }

.kihd-form input[type="text"]::placeholder,
.kihd-form input[type="email"]::placeholder,
.kihd-form input[type="tel"]::placeholder,
.kihd-form textarea::placeholder,
.kihd-login-box input::placeholder {
	color: var(--kp-text-muted, #888);
	opacity: .75;
}

.kihd-form input[type="text"]:focus,
.kihd-form input[type="email"]:focus,
.kihd-form input[type="tel"]:focus,
.kihd-form textarea:focus,
.kihd-form select:focus,
.kihd-login-box input:focus {
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--kp-form-accent, #5CA1C7) 30%, transparent);
}

.kihd-form select option {
	background: var(--kp-bg-alt, #fff);
	color: var(--kp-text, #222);
}

/* Straat+Huisnr. en Postcode+Plaats naast elkaar op één rij i.p.v. elk op
 * een eigen regel — zie includes/contact.php en includes/portaal.php
 * (kihd_render_nieuw_ticket_form()). Maakt het formulier een stuk korter.
 * De brede kolom (Straat/Plaats) krijgt de ruimte die overblijft, de smalle
 * kolom (Huisnr./Postcode) een vaste breedte, net als in het afgesproken
 * ontwerp. */
.kihd-form-rij {
	display: grid;
	gap: .8rem;
	align-items: start;
	margin-top: .6rem;
}
.kihd-form-rij-straat { grid-template-columns: minmax(0, 1fr) minmax(0, 180px); }
.kihd-form-rij-postcode { grid-template-columns: minmax(0, 150px) minmax(0, 1fr); }
.kihd-form-rij .kihd-form-veld {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.kihd-form-rij .kihd-form-veld label {
	margin-top: 0;
}
@media (max-width: 480px) {
	.kihd-form-rij-straat,
	.kihd-form-rij-postcode {
		grid-template-columns: 1fr;
	}
}

/* Validatie — zelfde rode accent als bij het osTicket-formulier
 * (.koperict-invalid daar, .kihd-invalid hier). */
.kihd-invalid {
	border-color: rgba(255, 94, 94, .85) !important;
	box-shadow: 0 0 0 3px rgba(255, 0, 0, .12) !important;
}

.kihd-hint {
	font-size: .85rem;
	opacity: .85;
	margin-top: .4rem;
	color: var(--kp-text-muted, #666);
}

.kihd-form button, .kihd-login-box button {
	margin-top: 1rem;
	align-self: flex-start;
}

.kihd-lijst-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.kihd-tickets-tabel {
	width: 100%;
	border-collapse: collapse;
}
.kihd-tickets-tabel th, .kihd-tickets-tabel td {
	text-align: left;
	padding: .6rem .5rem;
	border-bottom: 1px solid var(--kp-border, #eee);
}

.kihd-status {
	display: inline-block;
	padding: .15rem .6rem;
	border-radius: 99px;
	font-size: .78rem;
	font-weight: 600;
}
.kihd-status-open { background: color-mix(in srgb, #2a8a4a 18%, var(--kp-bg-card, #e3f3ea)); color: #2a8a4a; }
.kihd-status-gesloten { background: var(--kp-bg-alt, #eee); color: var(--kp-text-muted, #666); }

.kihd-thread {
	display: flex;
	flex-direction: column;
	gap: .8rem;
	margin: 1.2rem 0;
}
.kihd-bericht {
	border-radius: var(--kp-radius, 10px);
	padding: .8rem 1rem;
	border: 1px solid var(--kp-border, #ddd);
	color: var(--kp-text, #222);
}
.kihd-bericht-klant { background: var(--kp-bg-card, #f7fafc); }
.kihd-bericht-medewerker { background: color-mix(in srgb, #2a8a4a 10%, var(--kp-bg-card, #eef7ee)); }
.kihd-bericht-meta {
	display: flex;
	justify-content: space-between;
	font-size: .78rem;
	color: var(--kp-text-muted, #666);
	margin-bottom: .4rem;
}
.kihd-bericht-tekst { white-space: pre-wrap; }

.kihd-gesloten-melding {
	padding: .8rem 1rem;
	border-radius: var(--kp-radius, 10px);
	background: var(--kp-bg-alt, #f5f5f5);
	color: var(--kp-text-muted, #555);
}

/* Openbaar contactformulier ([koperict_helpdesk_contact]) — hergebruikt
 * .kihd-form voor de velden zelf; hier alleen de Turnstile-widget en de
 * uitgeschakelde-verstuurknop-status. */
.kihd-contact-form .kihd-contact-turnstile {
	margin-top: .8rem;
}
.kihd-contact-form button[type="submit"][disabled] {
	opacity: .55;
	cursor: not-allowed;
}
