/*
Theme Name: InfraPrep
Description: IT certification practice-exam site theme.
Version: 0.1.0
Author: local
Text Domain: infraprep
*/

:root {
	--ip-primary: #0066cc;
	--ip-primary-dark: #004a99;
	--ip-text: #1f2430;
	--ip-muted: #667085;
	--ip-bg: #f7f8fa;
	--ip-card-bg: #ffffff;
	--ip-border: #e2e5ea;
	--ip-success: #067647;
	--ip-danger: #b42318;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--ip-text);
	background: var(--ip-bg);
	margin: 0;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

a { color: var(--ip-primary); }

.ip-container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.ip-header {
	background: var(--ip-card-bg);
	border-bottom: 1px solid var(--ip-border);
}
.ip-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 0.85rem;
	padding-bottom: 0.85rem;
	gap: 1rem;
	flex-wrap: wrap;
}
.ip-logo {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	flex-shrink: 0;
	margin-right: 0.5rem;
}
.ip-logo-mark { width: 32px; height: 32px; display: block; flex-shrink: 0; }
.ip-logo-text {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--ip-text);
	white-space: nowrap;
	line-height: 1;
}

/* Search */
.ip-search {
	display: flex;
	align-items: center;
	flex: 1 1 240px;
	max-width: 420px;
	min-width: 0;
	background: var(--ip-bg);
	border: 1px solid var(--ip-border);
	border-radius: 8px;
	padding: 0.15rem 0.15rem 0.15rem 0.7rem;
}
.ip-search:focus-within { box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.35); }
.ip-search-input {
	border: none;
	background: transparent;
	flex: 1;
	min-width: 0;
	font-size: 0.9rem;
	padding: 0.4rem 0;
	outline: none;
}
.ip-search-btn {
	border: none;
	background: var(--ip-primary);
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}
.ip-search-btn svg { width: 16px; height: 16px; }
#ip-search-results { padding-top: 1rem; }
.ip-search-result {
	display: block;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--ip-border);
	border-radius: 8px;
	margin-bottom: 0.5rem;
	text-decoration: none;
	color: var(--ip-text);
	background: var(--ip-card-bg);
}
.ip-search-result strong { color: var(--ip-primary); }

.ip-nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.ip-nav a { color: var(--ip-text); text-decoration: none; font-size: 0.95rem; }
.ip-nav a:hover { color: var(--ip-primary); }
.ip-lang-switch { display: flex; gap: 0.35rem; font-size: 0.85rem; }
.ip-lang-switch a { padding: 0.15rem 0.4rem; border-radius: 4px; }
.ip-lang-switch a.is-active { background: var(--ip-primary); color: #fff; }

/* Main */
.ip-main { padding: 2rem 0 3rem; flex: 1 0 auto; width: 100%; }

/* Cards / catalog */
.certprep-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.certprep-card {
	background: var(--ip-card-bg);
	border: 1px solid var(--ip-border);
	border-radius: 12px;
	padding: 1.4rem;
	box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.certprep-card h3 { margin: 0.5rem 0 0.2rem; }
.certprep-vendor { color: var(--ip-muted); font-size: .85rem; margin: 0 0 .5rem; }

/* Neutral certification badges (no vendor logos/colors) */
.ip-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	color: #fff;
}
.ip-badge svg { width: 14px; height: 14px; }
.ip-badge-blue { background: #2563eb; }
.ip-badge-teal { background: #0d9488; }
.ip-badge-violet { background: #7c3aed; }
.ip-badge-slate { background: #475569; }

.certprep-btn {
	display: inline-block; background: var(--ip-primary); color: #fff;
	padding: .55rem 1.1rem; border-radius: 8px; text-decoration: none;
	border: none; cursor: pointer; margin-right: .5rem; font-size: .9rem;
}
.certprep-btn:hover { background: var(--ip-primary-dark); }
.certprep-btn-secondary { background: #475569; }
.certprep-btn-link { background: none; color: var(--ip-primary); text-decoration: underline; padding: 0; }

.certprep-unofficial { font-size: .8rem; color: var(--ip-muted); }
.certprep-dev-banner { background: #fef3c7; color: #92400e; padding: .5rem 1rem; text-align: center; font-weight: bold; border-radius: 8px; margin-bottom: 1rem; }

/* Study / exam question UI */
.certprep-choices { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.certprep-choice {
	display: flex; gap: .6rem; align-items: flex-start;
	border: 1px solid var(--ip-border); border-radius: 8px; padding: .6rem .8rem;
	background: var(--ip-card-bg); cursor: pointer;
}
.certprep-result { margin-top: 1rem; padding: 1rem; background: #f2f4f7; border-radius: 8px; }
.certprep-correct { color: var(--ip-success); font-weight: bold; }
.certprep-incorrect { color: var(--ip-danger); font-weight: bold; }
.certprep-locked { color: #92400e; font-weight: bold; }
.certprep-unlock { border: 1px dashed #999; padding: 1rem; border-radius: 8px; margin-top: 1rem; }

/* Exam mode */
.ip-exam-topbar {
	display: flex; justify-content: space-between; align-items: center;
	background: var(--ip-card-bg); border: 1px solid var(--ip-border);
	border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem;
}
.ip-exam-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.ip-exam-timer.is-low { color: var(--ip-danger); }
.ip-exam-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0; }
.ip-exam-nav button {
	width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--ip-border);
	background: #fff; cursor: pointer; font-size: .8rem;
}
.ip-exam-nav button.is-answered { background: #dbeafe; border-color: var(--ip-primary); }
.ip-exam-nav button.is-marked { outline: 2px solid #f59e0b; }
.ip-exam-nav button.is-current { background: var(--ip-primary); border-color: var(--ip-primary-dark); color: #fff; font-weight: bold; }
.ip-exam-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .78rem; color: var(--ip-muted); margin: 0 0 .5rem; }
.ip-exam-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.ip-exam-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--ip-border); }
.ip-exam-legend .i-answered { background: #dbeafe; border-color: var(--ip-primary); }
.ip-exam-legend .i-marked { border-color: #f59e0b; outline: 2px solid #f59e0b; }
.ip-exam-legend .i-current { background: var(--ip-primary); }
.ip-progress-bar { height: 8px; background: var(--ip-border); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.ip-progress-bar > div { height: 100%; background: var(--ip-primary); }
.ip-domain-score { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--ip-border); }

/* R-10/R-32: themed login page */
.certprep-login-page {
	max-width: 420px; margin: 2.5rem auto; background: var(--ip-card-bg);
	border: 1px solid var(--ip-border); border-radius: 10px; padding: 2rem;
}
.certprep-login-page h1 { margin-top: 0; font-size: 1.4rem; }
.certprep-login-error {
	background: #fef3f2; border: 1px solid var(--ip-danger); color: var(--ip-danger);
	padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; margin: 0 0 1rem;
}
#certprep-loginform p { margin: 0 0 1rem; }
#certprep-loginform label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .9rem; }
#certprep-loginform input[type="text"],
#certprep-loginform input[type="password"] {
	width: 100%; box-sizing: border-box; padding: .55rem .7rem;
	border: 1px solid var(--ip-border); border-radius: 6px; font-size: 1rem;
}
#certprep-loginform input[type="text"]:focus,
#certprep-loginform input[type="password"]:focus {
	outline: none; box-shadow: 0 0 0 3px rgba(0, 102, 204, .35); border-color: var(--ip-primary);
}
#certprep-loginform input[type="submit"] {
	background: var(--ip-primary); color: #fff; border: none; border-radius: 6px;
	padding: .6rem 1.2rem; font-size: 1rem; cursor: pointer;
}
#certprep-loginform input[type="submit"]:hover { background: var(--ip-primary-dark); }
#certprep-loginform label[for="rememberme"] { display: inline-flex; align-items: center; gap: .4rem; font-weight: normal; }
.certprep-login-links { margin-top: 1rem; font-size: .9rem; }

/* Footer */
.ip-footer { background: #101828; color: #d0d5dd; flex-shrink: 0; width: 100%; }
.ip-footer-inner { padding-top: 2rem; padding-bottom: 1.5rem; display: flex; flex-direction: column; gap: 1rem; box-sizing: border-box; }
.ip-footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .85rem; }
.ip-footer-links a { color: #d0d5dd; text-decoration: none; }
.ip-footer-links a:hover { text-decoration: underline; }
.ip-footer-unofficial {
	font-size: .78rem;
	color: #98a2b3;
	border-top: 1px solid #344054;
	padding-top: 1rem;
	word-break: break-word;
}

.ip-menu-toggle { display: none; }

@media (max-width: 640px) {
	.ip-header-inner { flex-direction: column; align-items: stretch; }
	.ip-logo { margin-right: 0; }
	.ip-search { flex: 0 0 auto; width: 100%; max-width: none; order: 3; }
	.ip-menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border: 1px solid var(--ip-border);
		border-radius: 6px;
		background: #fff;
		order: 2;
		align-self: flex-end;
		margin-top: -2.6rem;
		cursor: pointer;
	}
	.ip-menu-toggle svg { width: 20px; height: 20px; }
	.ip-nav {
		width: 100%;
		order: 4;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
		max-height: 0;
		overflow: hidden;
	}
	.ip-nav.is-open { max-height: 400px; padding-top: 0.5rem; }
	.ip-footer-links { flex-direction: column; gap: 0.6rem; }
}
