/**
 * NeuroClub 0.42.0 – final logic, auth and surface hardening.
 */
:root,
.neuroclub-terminal-shell,
.nc-terminal-page {
	--nc-42-surface: #ffffff;
	--nc-42-surface-raised: #ffffff;
	--nc-42-surface-soft: #f5f6f7;
	--nc-42-text: #20262d;
	--nc-42-muted: #66717b;
	--nc-42-line: #d8dde2;
	--nc-42-line-strong: #b7c0c9;
	--nc-42-danger: #b4232f;
	--nc-42-warning: #8a5a00;
	--nc-42-success: #237447;
	--nc-42-info: #285f8f;
}
.nc-theme-dark,
[data-nc-theme="dark"] {
	--nc-42-surface: #161b21;
	--nc-42-surface-raised: #1c232b;
	--nc-42-surface-soft: #11161b;
	--nc-42-text: #f2f4f6;
	--nc-42-muted: #b7c0c9;
	--nc-42-line: #35404b;
	--nc-42-line-strong: #566574;
	--nc-42-danger: #ff8b94;
	--nc-42-warning: #f5c66c;
	--nc-42-success: #80d6a5;
	--nc-42-info: #8bc8ff;
}

/* Startseite: fehlende Seiten sind ein echter Blocker, kein versteckter Checklisteneintrag. */
.nc-start-pages-warning {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
	margin: 18px 0 22px;
	padding: 18px 20px;
	border: 1px solid color-mix(in srgb, var(--nc-42-warning) 55%, var(--nc-42-line));
	border-left: 5px solid var(--nc-42-warning);
	border-radius: 3px;
	background: color-mix(in srgb, var(--nc-42-warning) 9%, var(--nc-42-surface-raised));
	color: var(--nc-42-text);
	box-shadow: none;
}
.nc-start-pages-warning > .dashicons {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid color-mix(in srgb, var(--nc-42-warning) 50%, transparent);
	background: color-mix(in srgb, var(--nc-42-warning) 12%, var(--nc-42-surface));
	color: var(--nc-42-warning);
	font-size: 23px;
}
.nc-start-pages-warning h2 { margin: 3px 0 6px; color: var(--nc-42-text); font-size: clamp(18px, 2vw, 24px); }
.nc-start-pages-warning p { max-width: 900px; margin: 0 0 13px; color: var(--nc-42-muted); }
.nc-start-pages-warning .nc-inline-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.nc-start-pages-warning form { margin: 0; }

/* Der letzte Oberflächenvertrag gewinnt bewusst gegen alte Modulfarben. */
.neuroclub-terminal-shell .nc-card,
.neuroclub-terminal-shell .nc-panel,
.neuroclub-terminal-shell .nc-table-card,
.nc-terminal-page .nc-terminal-auth-card,
.nc-terminal-page .nc-auth-panel,
.nc-theme-dark .nc-card,
[data-nc-theme="dark"] .nc-card {
	border-color: var(--nc-42-line);
	background: var(--nc-42-surface-raised);
	color: var(--nc-42-text);
}
.nc-theme-dark .widefat,
.nc-theme-dark .widefat td,
.nc-theme-dark .widefat th,
[data-nc-theme="dark"] .widefat,
[data-nc-theme="dark"] .widefat td,
[data-nc-theme="dark"] .widefat th {
	border-color: var(--nc-42-line) !important;
	background: var(--nc-42-surface-raised) !important;
	color: var(--nc-42-text) !important;
}
.nc-theme-dark .widefat thead th,
[data-nc-theme="dark"] .widefat thead th {
	background: var(--nc-42-surface-soft) !important;
	color: var(--nc-42-muted) !important;
}
.nc-theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
.nc-theme-dark textarea,
.nc-theme-dark select,
[data-nc-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
[data-nc-theme="dark"] textarea,
[data-nc-theme="dark"] select {
	border-color: var(--nc-42-line-strong) !important;
	background: var(--nc-42-surface-soft) !important;
	color: var(--nc-42-text) !important;
	box-shadow: none !important;
}
.nc-theme-dark input:disabled,
.nc-theme-dark textarea:disabled,
.nc-theme-dark select:disabled,
[data-nc-theme="dark"] input:disabled,
[data-nc-theme="dark"] textarea:disabled,
[data-nc-theme="dark"] select:disabled {
	opacity: .72;
	background: color-mix(in srgb, var(--nc-42-surface-soft) 75%, #000) !important;
}
.nc-theme-dark input::placeholder,
.nc-theme-dark textarea::placeholder,
[data-nc-theme="dark"] input::placeholder,
[data-nc-theme="dark"] textarea::placeholder { color: color-mix(in srgb, var(--nc-42-muted) 78%, transparent); }

/* Hinweise und Rückmeldungen erhalten auch im Darkmode klare Semantik. */
.nc-notice,
.nc-terminal-notice,
.nc-auth-success-state {
	border-radius: 3px;
	box-shadow: none;
}
.nc-theme-dark .nc-notice-info,
.nc-theme-dark .nc-terminal-notice.is-info,
[data-nc-theme="dark"] .nc-notice-info,
[data-nc-theme="dark"] .nc-terminal-notice.is-info { color: var(--nc-42-info); background: color-mix(in srgb, var(--nc-42-info) 10%, var(--nc-42-surface-raised)); border-color: color-mix(in srgb, var(--nc-42-info) 45%, var(--nc-42-line)); }
.nc-theme-dark .nc-notice-success,
.nc-theme-dark .nc-terminal-notice.is-success,
.nc-theme-dark .nc-auth-success-state,
[data-nc-theme="dark"] .nc-notice-success,
[data-nc-theme="dark"] .nc-terminal-notice.is-success,
[data-nc-theme="dark"] .nc-auth-success-state { color: var(--nc-42-success); background: color-mix(in srgb, var(--nc-42-success) 10%, var(--nc-42-surface-raised)); border-color: color-mix(in srgb, var(--nc-42-success) 45%, var(--nc-42-line)); }
.nc-theme-dark .nc-notice-warning,
.nc-theme-dark .nc-terminal-notice.is-warning,
[data-nc-theme="dark"] .nc-notice-warning,
[data-nc-theme="dark"] .nc-terminal-notice.is-warning { color: var(--nc-42-warning); background: color-mix(in srgb, var(--nc-42-warning) 10%, var(--nc-42-surface-raised)); border-color: color-mix(in srgb, var(--nc-42-warning) 45%, var(--nc-42-line)); }
.nc-theme-dark .nc-notice-error,
.nc-theme-dark .nc-terminal-notice.is-error,
[data-nc-theme="dark"] .nc-notice-error,
[data-nc-theme="dark"] .nc-terminal-notice.is-error { color: var(--nc-42-danger); background: color-mix(in srgb, var(--nc-42-danger) 10%, var(--nc-42-surface-raised)); border-color: color-mix(in srgb, var(--nc-42-danger) 45%, var(--nc-42-line)); }

/* Anmeldung: geradlinig, ruhig, auch bei langen Fehlermeldungen stabil. */
.nc-auth-layout { min-height: min(860px, calc(100vh - 24px)); align-items: center; }
.nc-terminal-auth-card { width: min(100%, 590px); }
.nc-terminal-form label { min-width: 0; }
.nc-terminal-form input,
.nc-terminal-form textarea { width: 100%; box-sizing: border-box; }
.nc-terminal-primary[aria-busy="true"],
button[aria-busy="true"] { cursor: progress; opacity: .72; }
.nc-terminal-primary[aria-busy="true"]::after,
button[aria-busy="true"]::after { content: " …"; }

/* Fokus und Touchflächen. */
.neuroclub-terminal-shell button,
.neuroclub-terminal-shell .button,
.nc-terminal-page button,
.nc-terminal-page a.nc-terminal-primary { min-height: 40px; }
.neuroclub-terminal-shell :focus-visible,
.nc-terminal-page :focus-visible { outline: 3px solid color-mix(in srgb, #8f1d2c 75%, #fff); outline-offset: 2px; }

@media (max-width: 782px) {
	.nc-start-pages-warning { grid-template-columns: 1fr; padding: 16px; }
	.nc-start-pages-warning > .dashicons { width: 38px; height: 38px; }
	.nc-start-pages-warning .nc-inline-actions,
	.nc-start-pages-warning .nc-inline-actions form,
	.nc-start-pages-warning .button { width: 100%; }
	.nc-start-pages-warning .button { display: flex; justify-content: center; align-items: center; }
	.nc-auth-layout { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); }
	.nc-terminal-auth-card { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.nc-start-pages-warning *,
	.nc-terminal-auth-card * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 0.42.0: normaler WordPress-Admin übernimmt denselben vollständigen Darkmode-Vertrag. */
html[data-nc-theme="dark"],
body.nc-theme-dark,
body.nc-theme-dark #wpwrap,
body.nc-theme-dark #wpcontent,
body.nc-theme-dark #wpbody,
body.nc-theme-dark #wpbody-content,
.nc-theme-dark.neuroclub-terminal-shell,
[data-nc-theme="dark"] body {
	background: #0f1419 !important;
	color: var(--nc-42-text) !important;
}
body.nc-theme-dark .wrap,
body.nc-theme-dark .neuroclub-wrap,
.nc-theme-dark .wrap,
.nc-theme-dark .neuroclub-wrap,
[data-nc-theme="dark"] .wrap,
[data-nc-theme="dark"] .neuroclub-wrap {
	color: var(--nc-42-text);
}
.nc-theme-dark .nc-page-header,
.nc-theme-dark .nc-page-header > div,
[data-nc-theme="dark"] .nc-page-header,
[data-nc-theme="dark"] .nc-page-header > div {
	color: var(--nc-42-text);
}
.nc-theme-dark .nc-page-header h1,
.nc-theme-dark .nc-page-header h2,
.nc-theme-dark .nc-page-header h3,
.nc-theme-dark .nc-card h1,
.nc-theme-dark .nc-card h2,
.nc-theme-dark .nc-card h3,
.nc-theme-dark .nc-card h4,
.nc-theme-dark .nc-card strong,
.nc-theme-dark .nc-card label,
.nc-theme-dark .nc-account-request h3,
.nc-theme-dark .nc-account-request label,
[data-nc-theme="dark"] .nc-page-header h1,
[data-nc-theme="dark"] .nc-page-header h2,
[data-nc-theme="dark"] .nc-card h2,
[data-nc-theme="dark"] .nc-card h3,
[data-nc-theme="dark"] .nc-card strong,
[data-nc-theme="dark"] .nc-card label {
	color: var(--nc-42-text) !important;
}
.nc-theme-dark .nc-page-header p,
.nc-theme-dark .nc-card p,
.nc-theme-dark .nc-card small,
.nc-theme-dark .nc-card span:not(.nc-status):not(.nc-badge):not(.dashicons),
.nc-theme-dark .nc-account-request small,
[data-nc-theme="dark"] .nc-page-header p,
[data-nc-theme="dark"] .nc-card p,
[data-nc-theme="dark"] .nc-card small {
	color: var(--nc-42-muted) !important;
}
.nc-theme-dark .nc-kicker,
[data-nc-theme="dark"] .nc-kicker {
	color: color-mix(in srgb, #ff9aa6 78%, var(--nc-42-text)) !important;
}
.nc-theme-dark .nc-account-request,
.nc-theme-dark .nc-account-request > header,
.nc-theme-dark .nc-account-request > form,
.nc-theme-dark .nc-card form,
[data-nc-theme="dark"] .nc-account-request,
[data-nc-theme="dark"] .nc-account-request > header,
[data-nc-theme="dark"] .nc-account-request > form,
[data-nc-theme="dark"] .nc-card form {
	border-color: var(--nc-42-line) !important;
	background: var(--nc-42-surface-raised) !important;
	color: var(--nc-42-text) !important;
}
.nc-theme-dark .nc-account-request > header,
[data-nc-theme="dark"] .nc-account-request > header {
	background: var(--nc-42-surface-soft) !important;
}
.nc-theme-dark a:not(.button):not(.nc-terminal-primary),
[data-nc-theme="dark"] a:not(.button):not(.nc-terminal-primary) {
	color: #9fd1ff;
}
.nc-theme-dark a:not(.button):not(.nc-terminal-primary):hover,
.nc-theme-dark a:not(.button):not(.nc-terminal-primary):focus,
[data-nc-theme="dark"] a:not(.button):not(.nc-terminal-primary):hover,
[data-nc-theme="dark"] a:not(.button):not(.nc-terminal-primary):focus {
	color: #c6e5ff;
}
.nc-theme-dark .button,
[data-nc-theme="dark"] .button {
	border-color: var(--nc-42-line-strong) !important;
	background: var(--nc-42-surface-soft) !important;
	color: var(--nc-42-text) !important;
	box-shadow: none !important;
}
.nc-theme-dark .button:hover,
.nc-theme-dark .button:focus,
[data-nc-theme="dark"] .button:hover,
[data-nc-theme="dark"] .button:focus {
	border-color: #8998a6 !important;
	background: #27313b !important;
	color: #fff !important;
}
.nc-theme-dark .button-primary,
[data-nc-theme="dark"] .button-primary {
	border-color: #a52b3b !important;
	background: #8f1d2c !important;
	color: #fff !important;
}
.nc-theme-dark .button-primary:hover,
.nc-theme-dark .button-primary:focus,
[data-nc-theme="dark"] .button-primary:hover,
[data-nc-theme="dark"] .button-primary:focus {
	border-color: #d84b5e !important;
	background: #b3263a !important;
}
.nc-theme-dark .nc-table-wrap,
.nc-theme-dark .nc-table-card,
[data-nc-theme="dark"] .nc-table-wrap,
[data-nc-theme="dark"] .nc-table-card {
	background: var(--nc-42-surface-raised) !important;
}
.nc-theme-dark .widefat tbody tr:nth-child(even) td,
[data-nc-theme="dark"] .widefat tbody tr:nth-child(even) td {
	background: color-mix(in srgb, var(--nc-42-surface-soft) 72%, var(--nc-42-surface-raised)) !important;
}
.nc-theme-dark .widefat tbody tr:hover td,
[data-nc-theme="dark"] .widefat tbody tr:hover td {
	background: #25303a !important;
}
