/*
 * The look of the app's own pages (login, password reset, locked, models,
 * settings), after https://exersim.com: Montserrat, its navy/orange palette
 * (the same token names as the site's :root), white rounded cards, orange
 * primary buttons and the text wordmark Exer<span>Sim</span>. The draw.io
 * editor keeps its own UI.
 *
 * Lives under styles/ because webapp/nginx.conf serves that prefix without
 * the login gate -- login.html needs it signed out. Linked with ?v=N: bump N
 * in every page when this file changes (styles/ has no no-cache rule).
 */

@font-face {
	/* Montserrat, variable weight, latin subset: SIL Open Font License 1.1,
	   fonts/montserrat/LICENSE. Self-hosted -- no request to Google. */
	font-family: 'Montserrat';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../../fonts/montserrat/montserrat-latin-wght-normal.woff2') format('woff2-variations'),
		url('../../fonts/montserrat/montserrat-latin-wght-normal.woff2') format('woff2');
}

:root {
	--ink: #1c244b;
	--steel: #5c6f8f;
	--blue-dark: #08306b;
	--blue: #133f86;
	--blue-light: #5ca4e0;
	--red: #a60f14;
	--orange: #fa6b4a;
	--orange-dark: #e9553a;
	--orange-soft: #ff8a6e;
	--mist: #eef4fb;
	--line: #d7e2f0;
	--line-strong: #c8d8ea;
	--surface: #fff;
	--page: #f7fafc;
	--danger: #c0392b;
	--ok: #1e7e34;
	--radius-card: 18px;
	--radius-control: 14px;
	--shadow-card: 0 12px 32px rgba(14, 58, 114, 0.06);
	--shadow-orange: 0 10px 24px rgba(250, 107, 74, 0.22);
	--shadow-header: 0 10px 28px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
	margin: 0;
	font-family: 'Montserrat', -apple-system, 'Segoe UI', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--page);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--blue-dark); }
h1, h2, h3 { color: var(--blue-dark); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 14px; }
p { margin: 0 0 14px; }

/* A small uppercase line above a heading, as on the site's cards. */
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--red); margin-bottom: 6px; }

/* ----------------------------------------------------------------- header */

header.site { background: var(--blue-dark); color: #fff; box-shadow: var(--shadow-header);
	position: relative; z-index: 2; }
header.site .bar { max-width: 1180px; margin: 0 auto; padding: 14px 28px; min-height: 68px;
	display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; flex-direction: column; color: #fff; text-decoration: none; line-height: 1; }
.wordmark { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.wordmark span { color: var(--orange); }
.brand .tagline { font-size: 11px; font-weight: 500; color: #c6d8ee; margin-top: 5px; letter-spacing: 0; }
header.site nav { display: flex; align-items: center; gap: 6px; font-size: 14px; }
header.site nav .who { color: #c6d8ee; font-weight: 500; padding: 0 8px; }
header.site nav #workspaceName { color: #fff; font-weight: 700; padding: 0 8px; }
header.site nav a, header.site nav button { color: #fff; background: none; border: 1px solid transparent;
	border-radius: 12px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer;
	text-decoration: none; }
header.site nav a:hover, header.site nav button:hover { background: rgba(255, 255, 255, 0.1); }
header.site nav button.ghost { border-color: rgba(255, 255, 255, 0.35); }
header.site nav select { font: inherit; font-weight: 600; color: var(--ink); background: #fff; max-width: 260px;
	border: none; border-radius: 12px; padding: 7px 10px; }

main { max-width: 1000px; margin: 40px auto; padding: 0 28px; }

/* -------------------------------------------------------------- controls */

button { font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: var(--radius-control);
	padding: 10px 18px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--blue-dark); }
button:hover:not(:disabled) { border-color: var(--blue-dark); }
button:disabled { opacity: 0.55; cursor: default; }
button.primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 800;
	box-shadow: var(--shadow-orange); }
button.primary:hover:not(:disabled) { background: var(--orange-dark); border-color: var(--orange-dark); }
button.secondary { background: var(--surface); border-color: var(--blue-dark); color: var(--blue-dark); }
button.secondary:hover:not(:disabled) { background: var(--mist); }

label { display: block; font-size: 13px; font-weight: 700; color: var(--blue-dark); margin-bottom: 6px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], textarea {
	width: 100%; padding: 11px 14px; margin-bottom: 18px; background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--radius-control); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-light);
	box-shadow: 0 0 0 3px rgba(92, 164, 224, 0.2); }
input:disabled { background: var(--mist); color: var(--steel); }
select { padding: 7px 10px; background: var(--surface); border: 1px solid var(--line-strong);
	border-radius: 10px; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue-dark); width: 16px; height: 16px; }

/* ---------------------------------------------------------- cards, panels */

.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
	box-shadow: var(--shadow-card); padding: 28px; }
.hint { font-size: 14px; color: var(--steel); }
.error-banner { background: #fdecea; color: var(--danger); padding: 12px 16px; border-radius: var(--radius-control);
	font-size: 14px; font-weight: 600; margin-bottom: 18px; display: none; }
.message { font-size: 13px; font-weight: 600; margin: -6px 0 14px; min-height: 18px; }
.message.ok { color: var(--ok); }
.message.error { color: var(--danger); }

/* Tabs: the models page's My models / Workspace and the settings tabs. */
.tabs, .tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a, .tab-bar button { background: none; border: none; border-radius: 0; box-shadow: none;
	padding: 10px 16px; margin-bottom: -1px; font-size: 14px; font-weight: 700; color: var(--steel);
	border-bottom: 3px solid transparent; cursor: pointer; text-decoration: none; }
.tabs a:hover, .tab-bar button:hover:not(:disabled) { color: var(--blue-dark); border-color: transparent;
	border-bottom-color: var(--line-strong); }
.tabs a.active, .tab-bar button.active { color: var(--blue-dark); border-bottom-color: var(--orange); }

/* ----------------------------------------------------------------- tables */

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
	border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
th, td { text-align: left; padding: 13px 18px; font-size: 14px; border-bottom: 1px solid var(--line); }
th { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel);
	background: var(--mist); }
tbody tr:hover { background: #f8fbfe; }
tbody tr:last-child td { border-bottom: none; }

/* ---------------------------------------------------------------- modals */

.modal-overlay { position: fixed; inset: 0; background: rgba(8, 48, 107, 0.35); display: flex;
	align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius-card); width: 440px; max-width: 100%;
	max-height: 75vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(8, 48, 107, 0.3); }
.modal h2 { font-size: 17px; margin: 0; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.modal .modal-body { padding: 14px 24px; overflow-y: auto; flex: 1; }
.modal .modal-footer { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ------------------------------------------------- sign-in pages (body.auth) */

body.auth { min-height: 100vh; display: flex; flex-direction: column; }
body.auth main { flex: 1; display: flex; align-items: flex-start; justify-content: center;
	margin: 0; padding: 64px 16px; max-width: none; }
body.auth .card { width: 420px; max-width: 100%; padding: 36px 40px; }
body.auth .card h1 { margin-bottom: 6px; }
body.auth .card .hint { margin: 0 0 24px; }
body.auth .card button { width: 100%; padding: 14px; }
body.auth .card button + button { margin-top: 10px; }
body.auth .error { color: var(--danger); font-size: 13px; font-weight: 600; margin: -8px 0 14px; min-height: 18px; }
body.auth .links { text-align: center; margin-top: 18px; font-size: 13px; }
body.auth .links a { font-weight: 600; }

/* ----------------------------------------------------------------- phones */

@media (max-width: 720px) {
	header.site .bar { flex-wrap: wrap; padding: 12px 16px; gap: 8px 16px; min-height: 0; }
	header.site nav { flex-wrap: wrap; gap: 2px; margin-left: -8px; }
	header.site nav select { max-width: 100%; }
	main { margin: 24px auto; padding: 0 16px; }
	/* A wide table scrolls inside its own box rather than the page. */
	table { display: block; overflow-x: auto; }
	.recent-card { flex-direction: column; align-items: stretch; }
	.recent-card .preview { width: 100%; }
	body.auth main { padding: 32px 16px; }
	body.auth .card { padding: 28px 22px; }
}
