/*
	The client portal (lot 17) on the Hublot design system: tokens, typography and hull come from
	Adviser.IA.SqlChat.Ui (hublot.css, loaded first). No Bootstrap here: the classes below are the
	board's own (Docs/Saas/planche-interactive/hublot.css), so its screens carry over as they are.
	Dark mode hangs on <html data-theme="dark">, never on a prefers-color-scheme query.
*/

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font: 400 16px/1.5 var(--font-text);
	-webkit-text-size-adjust: 100%;
}

h1, h2, h3, p {
	margin: 0;
}

h1 {
	font-size: 36px;
	font-weight: 700;
	line-height: 1.15;
}

h1:focus {
	outline: none;
}

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

button {
	font: inherit;
}

.muted {
	color: var(--ink2);
}

.small {
	font-size: 15px;
}

.nums {
	font-variant-numeric: tabular-nums;
}

.stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.stack-l {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.row-between {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: center;
	justify-content: space-between;
	min-width: 0;
}

.row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	min-width: 0;
}

.prose {
	max-width: 66ch;
}

.cols {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: flex-start;
}

.cols > * {
	min-width: 0;
}

.tone-ok {
	color: var(--ok);
}

/* Read by a screen reader, never seen. */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- fields ---------- */

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.field > label {
	font-weight: 600;
}

.input {
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}

.input:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 1px;
}

.input:disabled {
	background: var(--raised);
	color: var(--ink3);
}

textarea.input {
	display: block;
	resize: vertical;
}

/* The board's segmented choice: one pressed among a few. */
.seg {
	display: inline-flex;
	flex-wrap: wrap;
	border: 1px solid var(--line-strong);
}

.seg button {
	min-height: 42px;
	padding: 0 14px;
	border: 0;
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
}

.seg button:hover:not([aria-pressed="true"]) {
	background: var(--raised);
}

.seg button[aria-pressed="true"] {
	background: var(--primary);
	color: var(--on-primary);
	font-weight: 600;
}

.seg button:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: -2px;
}

/* ---------- buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 4px 18px;
	border: 1px solid transparent;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.btn:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.btn-primary {
	background: var(--cta);
	color: var(--on-cta);
	font-weight: 700;
}

.btn-primary:hover {
	background: var(--cta-hover);
}

.btn-second {
	background: var(--surface);
	color: var(--ink);
	border-color: var(--line-strong);
}

.btn-second:hover {
	background: var(--raised);
}

.btn-link {
	background: transparent;
	color: var(--primary);
	text-decoration: underline;
	padding-inline: 8px;
}

.btn[disabled] {
	background: transparent;
	color: var(--ink3);
	border: 1px dashed var(--line-strong);
	cursor: not-allowed;
	font-weight: 400;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chip {
	min-height: 44px;
	padding: 4px 12px;
	border: 1px solid var(--line-strong);
	background: transparent;
	color: var(--ink2);
	text-align: left;
	cursor: pointer;
}

.chip:hover:not([disabled]) {
	border-color: var(--primary);
	color: var(--ink);
}

.chip[disabled] {
	cursor: not-allowed;
	color: var(--ink3);
}

.chip:focus-visible,
.hublot-chip:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

/* The witness of the porthole: where the result goes. */
.hublot-chip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 2px 14px 2px 6px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--ink);
	text-align: left;
	cursor: pointer;
}

.hublot-chip:hover {
	background: var(--raised);
}

.btn-hull {
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--hull-tick);
	background: transparent;
	color: var(--hull-ink);
	cursor: pointer;
}

.btn-hull:hover {
	background: var(--hull-2);
}

.btn-hull:focus-visible {
	outline: 2px solid var(--hull-copper);
	outline-offset: 2px;
}

.row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* ---------- panels and notices ---------- */

.panel {
	background: var(--line);
	padding: 1px;
	clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
}

.panel-in {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	background: var(--surface);
	clip-path: polygon(15.6px 0, calc(100% - 15.6px) 0, 100% 15.6px, 100% calc(100% - 15.6px), calc(100% - 15.6px) 100%, 15.6px 100%, 0 calc(100% - 15.6px), 0 15.6px);
}

.notice {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 16px;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-top: 2px solid transparent;
	color: var(--ink);
}

.notice > div {
	flex: 1 1 280px;
	min-width: 0;
}

.notice-ok {
	background: var(--ok-soft);
	border-top-color: var(--ok);
}

.notice-warn {
	background: var(--warn-soft);
	border-top-color: var(--warn);
}

.notice-danger {
	background: var(--danger-soft);
	border-top-color: var(--danger);
}

.notice-info {
	background: var(--info-soft);
	border-top-color: var(--info);
}

/* ---------- answers ---------- */

.card {
	padding: 20px;
	border: 1px solid var(--line);
	background: var(--surface);
}

.turn {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.turn-q {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.steps {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ink3);
}

.steps li[data-on="true"] {
	color: var(--ink);
	font-weight: 600;
}

.steps li[data-done="true"] {
	color: var(--ok);
}

.tbl-wrap {
	overflow-x: auto;
	border: 1px solid var(--line);
	background: var(--surface);
}

.tbl {
	width: 100%;
	border-collapse: collapse;
	font: inherit;
	color: inherit;
	font-variant-numeric: tabular-nums;
}

.tbl th,
.tbl td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: middle;
}

.tbl thead th {
	border-bottom: 2px solid var(--line-strong);
	white-space: nowrap;
}

.tbl tbody tr:last-child > * {
	border-bottom: 0;
}

.tbl .n {
	text-align: right;
	white-space: nowrap;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 30px;
	padding: 2px 10px;
	font-weight: 600;
}

.pill-plain {
	background: var(--raised);
	color: var(--ink2);
}

details > summary {
	min-height: 28px;
	color: var(--primary);
	font-weight: 600;
	cursor: pointer;
}

pre.sql {
	margin: 8px 0 0;
	padding: 12px;
	background: var(--raised);
	color: var(--ink);
	font: 14px/1.5 var(--font-mono);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* ---------- outside the hull: the way to the sign-in, its failure ---------- */

.way {
	align-items: center;
	text-align: center;
}

.way-panel {
	width: min(560px, 100%);
}

/* ---------- the gauge of the hull ---------- */

.hull-meter {
	height: 8px;
	background: var(--hull-line);
}

.hull-meter > div {
	height: 8px;
	background: var(--hull-copper);
}

/* ---------- Blazor's own ---------- */

#blazor-error-ui {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 1000;
	width: 100%;
	padding: 10px 20px 11px;
	background: var(--warn-soft);
	color: var(--ink);
	box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
}

#blazor-error-ui .dismiss {
	position: absolute;
	top: 8px;
	right: 12px;
	cursor: pointer;
}

.loading-progress {
	position: relative;
	display: block;
	width: 8rem;
	height: 8rem;
	margin: 20vh auto 1rem auto;
}

.loading-progress circle {
	fill: none;
	stroke: var(--line);
	stroke-width: .6rem;
	transform-origin: 50% 50%;
	transform: rotate(-90deg);
}

.loading-progress circle:last-child {
	stroke: var(--ink2);
	stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
	transition: stroke-dasharray .05s ease-in-out;
}

.loading-progress-text {
	position: absolute;
	inset: calc(20vh + 3.25rem) 0 auto .2rem;
	text-align: center;
	font-weight: 600;
	color: var(--ink2);
}

.loading-progress-text:after {
	content: var(--blazor-load-percentage-text, "Chargement");
}
