/*
Theme Name:  PraxisSchutz
Theme URI:   https://example.com/praxisschutz-theme
Author:      PraxisSchutz
Author URI:  https://example.com
Description: Clinical-modern theme for medical practices using the PraxisSchutz compliance suite. Features a calm sage-green accent, paper background, Fraunces + Inter typography, a custom-styled login page, and templates that integrate with the PraxisSchutz plugin.
Version:     1.2.1
Tested up to: 6.5
Requires PHP: 8.0
License:     GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: praxisschutz
Tags:        custom-login, healthcare, accessibility-ready, translation-ready
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
	--ink-900: #1A1714;
	--ink-700: #4A4540;
	--ink-500: #7A746E;
	--ink-300: #BFB9B2;
	--paper:   #FBFAF7;
	--paper-2: #F5F2EC;
	--line:    #E5E0D8;
	--accent:  #1E5B4F;
	--accent-2:#2A7565;
	--accent-soft: #E8F0EC;
	--gold:    #B8893A;
	--gold-soft: #F7EFDB;
	--danger:  #B23A3A;
	--danger-soft: #F8E5E5;
	--warn:    #C57B1E;
	--warn-soft: #FBF0DC;
	--ok:      #1E5B4F;
	--ok-soft: #E8F0EC;
	--radius:  10px;
	--radius-sm: 6px;
	--radius-lg: 16px;
	--shadow:  0 1px 2px rgba(26,23,20,0.04), 0 4px 12px rgba(26,23,20,0.04);
	--shadow-lg: 0 8px 32px rgba(26,23,20,0.08);
	--mono: 'JetBrains Mono', ui-monospace, monospace;
	--font-serif: 'Fraunces', Georgia, serif;
	--font-sans:  'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-sans);
	color: var(--ink-900);
	background: var(--paper);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
	font-family: var(--font-serif);
	font-weight: 500;
	letter-spacing: -0.02em;
	color: var(--ink-900);
	margin: 0 0 0.5em;
}
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 2.5vw, 30px); }
h3 { font-size: 20px; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Accent mark used as decorative element */
.accent-mark {
	display: inline-block;
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--gold);
	margin-left: 12px;
	vertical-align: middle;
}

/* Layout container */
.ps-container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
}

/* === Site header === */
.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	position: sticky; top: 0; z-index: 100;
	backdrop-filter: blur(8px);
}
.site-header-inner {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 0;
}
.site-brand {
	display: inline-flex; align-items: center; gap: 10px;
	text-decoration: none; color: var(--ink-900);
}
.site-brand-mark {
	width: 30px; height: 30px; border-radius: 8px;
	background: var(--accent); color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
	font-family: var(--font-serif); font-weight: 600;
}
.site-brand-name {
	font-family: var(--font-serif); font-weight: 500; font-size: 20px;
}
.site-nav {
	display: flex; gap: 24px; align-items: center;
}
.site-nav a {
	color: var(--ink-700); font-size: 14px; font-weight: 500;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* === Hero (front page) === */
.ps-hero {
	padding: 80px 0 60px;
	background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
	border-bottom: 1px solid var(--line);
}
.ps-hero h1 {
	max-width: 760px;
	font-size: clamp(34px, 5vw, 56px);
	line-height: 1.1; margin-bottom: 16px;
}
.ps-hero .lead {
	max-width: 580px; font-size: 18px; color: var(--ink-700);
}
.ps-hero .actions {
	display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap;
}

/* === Buttons === */
.ps-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 18px; border-radius: var(--radius-sm);
	font-family: var(--font-sans); font-weight: 500; font-size: 14px;
	border: 1px solid var(--line); background: #fff; color: var(--ink-900);
	cursor: pointer; text-decoration: none;
	transition: all 0.15s ease;
}
.ps-btn:hover {
	border-color: var(--accent); color: var(--accent); text-decoration: none;
}
.ps-btn-primary {
	background: var(--accent); color: #fff; border-color: var(--accent);
}
.ps-btn-primary:hover {
	background: var(--accent-2); color: #fff; border-color: var(--accent-2);
	transform: translateY(-1px); box-shadow: var(--shadow);
}
.ps-btn-gold {
	background: var(--gold); border-color: var(--gold); color: #fff;
}
.ps-btn-gold:hover { filter: brightness(1.08); color: #fff; }

/* === Page content === */
.site-main { padding: 60px 0; min-height: 60vh; }

.page-content h1, .page-content h2 { margin-top: 1.5em; }
.page-content p { max-width: 760px; }

/* === Cards === */
.ps-card {
	background: #fff; border: 1px solid var(--line);
	border-radius: var(--radius); padding: 24px;
	box-shadow: var(--shadow);
}

/* === Features grid (front page) === */
.ps-features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px; margin: 40px 0;
}
.ps-feature {
	padding: 24px; background: #fff;
	border: 1px solid var(--line); border-radius: var(--radius);
	position: relative;
}
.ps-feature::before {
	content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
	background: var(--accent); border-radius: var(--radius) var(--radius) 0 0;
}
.ps-feature-icon {
	width: 40px; height: 40px; border-radius: 8px;
	background: var(--accent-soft); color: var(--accent);
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 20px; margin-bottom: 12px;
}
.ps-feature h3 { font-size: 18px; margin: 0 0 6px; }
.ps-feature p { font-size: 14px; color: var(--ink-700); margin: 0; }

/* === Portal === */
.ps-portal {
	max-width: 1080px; margin: 0 auto; padding: 40px 24px;
}
.ps-portal-head { margin-bottom: 32px; }
.ps-portal-greeting {
	font-family: var(--font-serif); font-size: 38px; font-weight: 500;
	margin: 0 0 8px;
}
.ps-portal-sub { color: var(--ink-700); max-width: 700px; }
.ps-portal-grid {
	display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.ps-portal-card {
	background: #fff; border: 1px solid var(--line);
	border-radius: var(--radius); overflow: hidden;
}
.ps-portal-card--full { grid-column: 1 / -1; }
.ps-portal-card-head {
	padding: 16px 20px; border-bottom: 1px solid var(--line);
	background: var(--paper-2);
}
.ps-portal-card-head h2 {
	font-size: 18px; margin: 0; font-family: var(--font-serif);
}
.ps-portal-card-body { padding: 18px 20px; }
.ps-portal-list { list-style: none; margin: 0; padding: 0; }
.ps-portal-list li {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px;
}
.ps-portal-list li:last-child { border-bottom: 0; }
.ps-portal-list small {
	display: block; color: var(--ink-500); font-size: 12px;
}

.ps-quick {
	display: flex; gap: 12px; align-items: center;
	padding: 12px; border: 1px solid var(--line);
	border-radius: var(--radius-sm); text-decoration: none;
	color: var(--ink-900); margin-bottom: 8px;
}
.ps-quick:hover {
	border-color: var(--accent); background: var(--accent-soft);
	text-decoration: none;
}
.ps-quick-icon {
	width: 36px; height: 36px; border-radius: 8px;
	background: var(--accent-soft); color: var(--accent);
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 18px;
}
.ps-quick strong { display: block; font-size: 14px; }
.ps-quick small { display: block; color: var(--ink-500); font-size: 12px; }

.ps-tick {
	color: var(--ok); font-size: 18px; font-weight: 600;
}

@media (max-width: 720px) {
	.ps-portal-grid { grid-template-columns: 1fr; }
	.site-nav { gap: 12px; font-size: 12px; }
}

/* === Login required notice === */
.ps-login-required {
	padding: 24px; background: var(--gold-soft);
	border-left: 3px solid var(--gold); border-radius: var(--radius-sm);
	margin: 24px 0;
}

/* === Form inputs in portal === */
.ps-portal input[type="text"],
.ps-portal input[type="email"],
.ps-portal input[type="datetime-local"],
.ps-portal input[type="number"],
.ps-portal select,
.ps-portal textarea {
	width: 100%; padding: 10px 12px;
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	font-family: var(--font-sans); font-size: 14px; background: #fff;
}
.ps-portal label { display: block; margin-bottom: 12px; font-weight: 500; font-size: 13px; color: var(--ink-700); }
.ps-portal label span { display: block; margin-bottom: 4px; }
.ps-portal .ps-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .ps-portal .ps-form-row { grid-template-columns: 1fr; } }

.ps-checkbox { display: flex; align-items: center; gap: 8px; }

.ps-checklist-form .ps-checklist-item {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px;
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	margin-bottom: 6px; cursor: pointer;
}
.ps-checklist-form .ps-checklist-item:hover { background: var(--paper-2); }
.ps-checklist-result {
	padding: 14px; border-radius: var(--radius-sm);
	margin-top: 14px; background: var(--ok-soft); color: var(--ok);
	font-family: var(--mono); font-size: 13px;
}

.ps-training-content {
	background: #fff; padding: 24px; border: 1px solid var(--line);
	border-radius: var(--radius); margin-bottom: 24px;
}
.ps-training-quiz fieldset {
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	padding: 16px; margin-bottom: 12px;
}
.ps-training-quiz legend { font-weight: 500; padding: 0 8px; }
.ps-training-quiz label {
	display: flex; align-items: center; gap: 8px;
	padding: 6px 0;
}
.ps-training-result {
	padding: 14px; border-radius: var(--radius-sm);
	margin-top: 14px; background: var(--ok-soft); color: var(--ok);
	font-weight: 500;
}

/* === Footer === */
.site-footer {
	border-top: 1px solid var(--line);
	background: var(--paper-2);
	padding: 40px 0;
	font-size: 13px; color: var(--ink-500);
}
.site-footer-grid {
	display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
}
.site-footer h4 { font-family: var(--font-sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-700); margin-bottom: 12px; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink-700); }
@media (max-width: 720px) { .site-footer-grid { grid-template-columns: 1fr; } }

/* === Login styles override wp-login.php === */
/* Loaded only on wp-login.php via login_enqueue_scripts. */
body.login {
	background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%) !important;
	font-family: var(--font-sans) !important;
}

/* === Front-end login page (template-login.php / [praxisschutz_login_form]) === */
/* wp-login.php is NOT styled by this theme — these rules only apply to our own page. */

body.page-template-template-login .site-main,
body.ps-login-page .site-main {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - 220px);
	padding: 60px 16px;
	background:
		radial-gradient(circle at 20% 0%, rgba(30, 91, 79, 0.06) 0%, transparent 50%),
		radial-gradient(circle at 80% 100%, rgba(184, 137, 58, 0.05) 0%, transparent 50%),
		linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}

.ps-login-wrap {
	width: 100%;
	max-width: 440px;
}

.ps-login-brand {
	text-align: center;
	margin-bottom: 28px;
}

.ps-login-mark {
	display: inline-block;
	width: 56px;
	height: 56px;
	border-radius: 14px;
	background: var(--accent);
	background-image: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
	box-shadow:
		0 8px 24px rgba(30, 91, 79, 0.25),
		inset 0 -2px 0 rgba(0,0,0,0.1);
	position: relative;
	margin-bottom: 14px;
}
.ps-login-mark::before {
	content: '';
	position: absolute;
	left: 20px; top: 18px;
	width: 16px; height: 16px;
	border-radius: 50%;
	background: var(--paper);
}
.ps-login-mark::after {
	content: '';
	position: absolute;
	right: -4px; top: -4px;
	width: 12px; height: 12px;
	border-radius: 50%;
	background: var(--gold);
	box-shadow: 0 2px 6px rgba(184, 137, 58, 0.4);
}

.ps-login-name {
	font-family: var(--font-serif);
	font-size: 28px;
	font-weight: 500;
	margin: 0 0 6px;
	letter-spacing: -0.02em;
}

.ps-login-tagline {
	font-size: 13px;
	color: var(--ink-500);
	margin: 0;
}

.ps-login-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow:
		0 1px 2px rgba(26,23,20,0.04),
		0 16px 48px rgba(26,23,20,0.08);
	padding: 32px;
	position: relative;
	overflow: hidden;
}

.ps-login-card::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 50%, var(--gold) 100%);
}

.ps-login-error {
	background: var(--danger-soft);
	border: 1px solid #F0CECE;
	border-left: 3px solid var(--danger);
	border-radius: var(--radius-sm);
	padding: 12px 16px;
	margin-bottom: 18px;
	color: var(--danger);
	font-size: 13px;
	line-height: 1.5;
}
.ps-login-error a { color: var(--danger); text-decoration: underline; }

.ps-login-label {
	display: block;
	margin-bottom: 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ink-700);
}
.ps-login-label span {
	display: block;
	margin-bottom: 6px;
}
.ps-login-label input {
	width: 100%;
	padding: 12px 14px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	font-family: var(--font-sans);
	font-size: 15px;
	color: var(--ink-900);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ps-login-label input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.ps-login-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	font-size: 13px;
	color: var(--ink-700);
	cursor: pointer;
}
.ps-login-check input {
	accent-color: var(--accent);
	margin: 0;
}

.ps-login-submit {
	width: 100%;
	padding: 12px 22px;
	background: var(--accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius-sm);
	color: #fff;
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 15px;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(30, 91, 79, 0.2);
	transition: all 0.15s ease;
}
.ps-login-submit:hover {
	background: var(--accent-2);
	border-color: var(--accent-2);
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(30, 91, 79, 0.3);
}
.ps-login-submit:active { transform: none; }

.ps-login-links {
	margin-top: 18px;
	text-align: center;
	font-size: 13px;
	color: var(--ink-500);
}
.ps-login-links a {
	color: var(--ink-500);
	text-decoration: none;
	margin: 0 6px;
}
.ps-login-links a:hover {
	color: var(--accent);
	text-decoration: none;
}

@media (max-width: 480px) {
	.ps-login-card { padding: 24px; }
	.ps-login-name { font-size: 24px; }
}
