/* ==========================================================================
   DjobsInfo Core — Frontend App Theme
   Aesthetic: refined editorial / utilitarian. White canvas, ink-black type,
   one sharp red accent. Bricolage display + DM Sans body + Space Mono data.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&family=Space+Mono:wght@400;700&display=swap');

.djobs-app {
	/* ---- Design tokens ---- */
	--ink: #0a0a0a;
	--ink-soft: #3a3a3a;
	--muted: #8a8a8a;
	--paper: #ffffff;
	--paper-2: #faf7f5;
	--line: #ececec;
	--line-2: #e0dcd8;
	--red: #e4002b;
	--red-ink: #b80022;
	--red-wash: #fff1f3;
	--shadow: 0 1px 2px rgba(10, 10, 10, .04), 0 8px 28px rgba(10, 10, 10, .06);
	--shadow-lg: 0 2px 6px rgba(10, 10, 10, .06), 0 24px 60px rgba(10, 10, 10, .12);
	--radius: 14px;
	--radius-sm: 10px;
	--ff-display: 'Bricolage Grotesque', Georgia, serif;
	--ff-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--ff-mono: 'Space Mono', ui-monospace, monospace;

	max-width: 1140px;
	margin: 0 auto;
	padding: 0 18px 64px;
	color: var(--ink);
	font-family: var(--ff-body);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.djobs-app *,
.djobs-app *::before,
.djobs-app *::after { box-sizing: border-box; }

.djobs-app .hidden { display: none !important; }
.djobs-app .muted { color: var(--muted); font-size: .92em; }

/* ---- Header ---- */
.djobs-header {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 18px 0 14px;
	margin-bottom: 26px;
	background: linear-gradient(var(--paper) 78%, rgba(255, 255, 255, 0));
	border-bottom: 1px solid var(--line);
}

.djobs-brand { display: flex; align-items: baseline; gap: 9px; }
.djobs-logo {
	font-family: var(--ff-display);
	font-weight: 800;
	font-size: 30px;
	letter-spacing: -.04em;
	line-height: 1;
	color: var(--ink);
}
.djobs-logo .dot { color: var(--red); }
.djobs-brandname {
	font-family: var(--ff-display);
	font-weight: 700;
	font-size: 16px;
	letter-spacing: -.01em;
}

.djobs-nav {
	display: flex;
	gap: 4px;
	margin-left: auto;
	overflow-x: auto;
	scrollbar-width: none;
}
.djobs-nav::-webkit-scrollbar { display: none; }

.djobs-tab {
	position: relative;
	flex: 0 0 auto;
	border: 0;
	background: none;
	cursor: pointer;
	font-family: var(--ff-body);
	font-weight: 500;
	font-size: 14.5px;
	color: var(--ink-soft);
	padding: 8px 12px;
	border-radius: 999px;
	transition: color .18s ease, background .18s ease;
}
.djobs-tab:hover { color: var(--ink); background: var(--paper-2); }
.djobs-tab.is-active { color: var(--red); }
.djobs-tab.is-active::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: -1px;
	height: 2px;
	background: var(--red);
	border-radius: 2px;
}

/* ---- Cards ---- */
.djobs-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	box-shadow: var(--shadow);
}
.djobs-card h2 { font-family: var(--ff-display); font-weight: 700; font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
.djobs-card h3 { font-family: var(--ff-display); font-weight: 700; font-size: 21px; margin: 0 0 4px; letter-spacing: -.02em; }
.djobs-card h4 { font-family: var(--ff-display); font-weight: 700; font-size: 15px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.djobs-card hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.djobs-full { grid-column: 1 / -1; }

/* ---- Auth gate ---- */
.djobs-auth { display: flex; justify-content: center; padding: 30px 0; }
.djobs-auth-card { width: 100%; max-width: 420px; }
.djobs-otp-step { margin-top: 14px; }
.djobs-consent {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 13.5px;
	color: var(--ink-soft);
	margin: 12px 0 16px;
	cursor: pointer;
}
.djobs-consent input { margin-top: 3px; accent-color: var(--red); }

/* ---- Fields ---- */
.djobs-label { display: block; font-weight: 600; font-size: 13px; margin: 18px 0 7px; letter-spacing: .01em; }
.djobs-field { margin-bottom: 12px; }
.djobs-app input[type="email"],
.djobs-app input[type="url"],
.djobs-app input[type="text"],
.djobs-app textarea {
	width: 100%;
	font-family: var(--ff-body);
	font-size: 15px;
	color: var(--ink);
	background: var(--paper-2);
	border: 1.5px solid var(--line-2);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.djobs-app textarea { resize: vertical; line-height: 1.55; }
.djobs-app input:focus,
.djobs-app textarea:focus {
	outline: none;
	background: var(--paper);
	border-color: var(--red);
	box-shadow: 0 0 0 4px var(--red-wash);
}
.djobs-app input::placeholder,
.djobs-app textarea::placeholder { color: #b6b1ac; }

#djobs-otp-code { letter-spacing: .55em; text-align: center; font-family: var(--ff-mono); font-size: 20px; }

.djobs-url-row { display: flex; gap: 8px; }
.djobs-url-row .djobs-url { flex: 1; }

/* ---- Buttons ---- */
.djobs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--ff-body);
	font-weight: 600;
	font-size: 14.5px;
	line-height: 1;
	padding: 12px 20px;
	border-radius: var(--radius-sm);
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
	white-space: nowrap;
}
.djobs-btn:active { transform: translateY(1px); }
.djobs-btn[disabled] { opacity: .55; cursor: not-allowed; }

.djobs-btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(228, 0, 43, .28); width: 100%; margin-top: 6px; }
.djobs-btn-primary:hover:not([disabled]) { background: var(--red-ink); }

.djobs-btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.djobs-btn-ghost:hover:not([disabled]) { border-color: var(--ink); }

.djobs-btn-danger { background: var(--paper); color: var(--red); border-color: rgba(228, 0, 43, .35); }
.djobs-btn-danger:hover:not([disabled]) { background: var(--red); color: #fff; border-color: var(--red); }

.djobs-msg { min-height: 20px; margin: 10px 0 0; font-size: 13.5px; }
.djobs-msg.is-ok { color: #1a7f37; }
.djobs-msg.is-err { color: var(--red-ink); }

/* ---- Workspace / two-pane ---- */
.djobs-view { display: none; }
.djobs-view.is-active { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.djobs-view[data-view="history"].is-active { display: block; }

.djobs-pane { min-width: 0; }
.djobs-result-pane { position: sticky; top: 92px; }
.djobs-result {
	min-height: 220px;
	border: 1px dashed var(--line-2);
	border-radius: var(--radius);
	padding: 20px;
	background: var(--paper-2);
}
.djobs-result:empty::before {
	content: "Your results will appear here.";
	color: var(--muted);
	font-size: 14px;
}

/* ---- Upload ---- */
.djobs-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.djobs-cv-status.has-file { color: #1a7f37; font-weight: 600; }

/* ---- Result rendering ---- */
.djobs-rcard { animation: djobs-rise .4s ease both; }
.djobs-rtitle { font-family: var(--ff-display); font-weight: 700; font-size: 19px; margin: 0 0 14px; letter-spacing: -.01em; }

.djobs-score-wrap { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.djobs-score {
	font-family: var(--ff-mono);
	font-weight: 700;
	font-size: 44px;
	line-height: 1;
	color: var(--red);
}
.djobs-score small { font-size: 20px; color: var(--muted); }
.djobs-confidence { font-size: 13px; color: var(--ink-soft); }
.djobs-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.djobs-bar > span { display: block; height: 100%; background: var(--red); border-radius: 99px; width: 0; transition: width .8s cubic-bezier(.2,.7,.2,1); }

.djobs-section { margin: 16px 0; }
.djobs-section h5 { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 7px; }
.djobs-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.djobs-chip { font-size: 13px; padding: 5px 11px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line-2); }
.djobs-chip.is-missing { background: var(--red-wash); border-color: rgba(228, 0, 43, .25); color: var(--red-ink); }
.djobs-list { margin: 0; padding-left: 18px; }
.djobs-list li { margin-bottom: 6px; }
.djobs-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14.5px; }
.djobs-kv dt { color: var(--muted); }

.djobs-result-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.djobs-result-actions .djobs-btn { width: auto; margin: 0; }

/* ---- States: skeleton / timeout / error ---- */
.djobs-skel { display: flex; flex-direction: column; gap: 12px; }
.djobs-skel-bar {
	height: 14px;
	border-radius: 8px;
	background: linear-gradient(100deg, var(--line) 30%, #f4f1ee 50%, var(--line) 70%);
	background-size: 200% 100%;
}
.djobs-skel-bar.lg { height: 40px; width: 45%; }
.djobs-skel-bar.w70 { width: 70%; }
.djobs-skel-bar.w90 { width: 90%; }
.djobs-skel-bar.w50 { width: 50%; }

.djobs-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	padding: 32px 18px;
	animation: djobs-rise .35s ease both;
}
.djobs-state .ico {
	width: 42px; height: 42px; border-radius: 50%;
	display: grid; place-items: center;
	font-family: var(--ff-display); font-weight: 800; font-size: 22px;
}
.djobs-state.is-timeout .ico { background: var(--red-wash); color: var(--red); }
.djobs-state.is-error .ico { background: #fdeaea; color: var(--red-ink); }
.djobs-state p { margin: 0; max-width: 360px; color: var(--ink-soft); font-size: 14.5px; }

/* ---- History list ---- */
.djobs-hist-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	margin-bottom: 8px;
	background: var(--paper);
}
.djobs-hist-item .tool { font-weight: 600; }
.djobs-hist-item .date { font-size: 12.5px; color: var(--muted); font-family: var(--ff-mono); }
.djobs-gdpr { display: flex; gap: 10px; flex-wrap: wrap; }
.djobs-gdpr .djobs-btn { width: auto; margin: 0; }

/* ---- Footer ---- */
.djobs-footer {
	margin-top: 40px;
	padding-top: 18px;
	border-top: 1px solid var(--line);
	text-align: center;
	font-size: 12.5px;
	color: var(--muted);
	letter-spacing: .03em;
}

/* ---- Animations ---- */
@keyframes djobs-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Mobile: stack two-pane vertically (blueprint §4) ---- */
@media (max-width: 768px) {
	.djobs-app { padding: 0 14px 48px; }
	.djobs-header { gap: 14px; flex-wrap: wrap; padding-top: 14px; }
	.djobs-nav { margin-left: 0; width: 100%; }
	.djobs-view.is-active { grid-template-columns: 1fr; }
	.djobs-result-pane { position: static; }
	.djobs-card { padding: 18px; }
	.djobs-logo { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
	.djobs-app *, .djobs-app *::before, .djobs-app *::after { animation: none !important; transition: none !important; }
}
