/**
 * Twine login screen
 *
 * Two-pane login design (brand pane + form pane).
 * Adapted from design/twine.html. Loaded only on the signed-out pages --
 * login and password reset, which draw the same shell from
 * functions/TwineLoginPage.fnc.php -- so it is fully self-contained
 * and does not affect the rest of the app.
 *
 * @package RosarioSIS
 * @subpackage Twine
 */

#twine-login {
	/* core palette - warm paper + electric twine blue */
	--ink: #161413;
	--ink-soft: #5b5550;
	--ink-faint: #938b83;
	--paper: #f4f1ea;
	--paper-2: #ebe6db;
	--card: #fffdf8;
	--line: #e2dccf;
	--line-strong: #d2c9b6;
	--blue: #0a48ff;
	--blue-deep: #0530b0;
	--blue-wash: #e8ecff;
	--clay: #d8552a;
	--r-sm: 10px;

	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	grid-template-columns: 1.05fr .95fr;
	background: var(--paper);
	color: var(--ink);
	font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-align: left;
}

/* Neutralise the shared theme rules on the signed-out pages. */
body.login,
body.password-reset {
	overflow: hidden;
	padding: 0 !important;
}

#twine-login *,
#twine-login *::before,
#twine-login *::after {
	box-sizing: border-box;
}

#twine-login .tw-serif {
	font-family: 'Fraunces', Georgia, serif;
	font-optical-sizing: auto;
}

#twine-login a {
	color: inherit;
	text-decoration: none;
}

#twine-login ::selection {
	background: var(--blue);
	color: #fff;
}

/* ============ brand pane ============ */
#twine-login .tw-brandpane {
	position: relative;
	overflow: hidden;
	/* Twine artwork. It is 73% pure white, the rest pale blue and cream, so
	   every foreground colour on this pane is dark ink -- the white type this
	   pane used to carry over the blue gradient would be invisible on it.
	   The flat colour underneath shows while the file loads, and if it ever
	   goes missing the pane degrades to white rather than to unreadable. */
	background: #fff url('../../img/background-neuronal.jpg') center / cover no-repeat;
	color: var(--ink);
	padding: 56px 64px;
	display: flex;
	flex-direction: column;
}

/* The artwork draws its own woven lines, so the hatch overlay that textured
   the gradient is gone, and so is the blue glow -- on a white pane it reads
   as a smudge rather than as depth. The .tw-glow div is left in the markup:
   reverting this one file brings the gradient design back whole. */
#twine-login .tw-glow {
	display: none;
}

#twine-login .tw-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
	font-size: 21px;
	letter-spacing: -.02em;
	position: relative;
	z-index: 2;
	/* Hug the logo chip (don't stretch to the pane width) so the absolutely
	   positioned SANDBOX flag centers over the logo, not over the whole pane. */
	align-self: flex-start;
}

#twine-login .tw-logo .tw-logo-img {
	display: block;
	height: 84px;
	width: auto;
	/* logo.png has a white background and so has the artwork behind it. The
	   chip stays anyway: without it the logo's white block shows as a faint
	   rectangle wherever a pale line passes behind. A soft shadow instead of
	   the old navy one is what makes it read as a badge on a light pane. */
	padding: 11px 16px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 6px 20px rgba(22, 20, 19, .10);
}

/* Twine: red SANDBOX flag stamped over the logo on non-production instances. */
#twine-login .tw-logo .tw-sandbox-flag {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-9deg);
	z-index: 3;
	pointer-events: none;
	font-family: 'Hanken Grotesk', sans-serif;
	font-weight: 800;
	font-size: 26px;
	line-height: 1;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #e01120;
	background: rgba(255, 255, 255, .82);
	padding: 5px 14px 5px 18px;
	border: 2px solid #e01120;
	border-radius: 6px;
	box-shadow: 0 6px 18px rgba(224, 17, 32, .35);
}

#twine-login .tw-lead {
	margin-top: auto;
	position: relative;
	z-index: 2;
	color: blue;
}

#twine-login .tw-brandpane h1 {
	font-weight: 500;
	font-size: clamp(34px, 3.6vw, 52px);
	line-height: 1.05;
	letter-spacing: -.02em;
	max-width: 13ch;
	margin: 0;
}

#twine-login .tw-brandpane h1 em {
	font-size: inherit;
	line-height: inherit;
	font-style: italic;
	color: var(--blue);
}

#twine-login .tw-brandpane p.tw-sub {
	margin-top: 22px;
	font-size: 16px;
	color: var(--ink-soft);
	max-width: 42ch;
	line-height: 1.55;
}

#twine-login .tw-pills {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 34px;
	position: relative;
	z-index: 2;
}

#twine-login .tw-pill {
	font-size: 12.5px;
	font-weight: 500;
	padding: 7px 13px;
	border-radius: 100px;
	background: rgba(255, 255, 255, .72);
	border: 1px solid var(--line);
	color: var(--ink-soft);
}

/* ============ form pane ============ */
#twine-login .tw-formpane {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	overflow-y: auto;
}

#twine-login .tw-formcard {
	width: 100%;
	max-width: 380px;
}

#twine-login .tw-langs {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 26px;
}

#twine-login .tw-langs img {
	height: 24px;
	border-radius: 3px;
	display: block;
	opacity: .8;
	transition: opacity .15s, transform .12s;
}

#twine-login .tw-langs a:hover img {
	opacity: 1;
	transform: translateY(-1px);
}

#twine-login .tw-eyebrow {
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ink-faint);
	font-weight: 600;
}

#twine-login .tw-formcard h2 {
	font-weight: 500;
	font-size: 32px;
	letter-spacing: -.02em;
	margin: 10px 0 4px;
}

#twine-login .tw-muted {
	color: var(--ink-soft);
	font-size: 14.5px;
	margin-bottom: 26px;
}

/* error / note messages */
#twine-login .tw-msg {
	border-radius: var(--r-sm);
	padding: 12px 14px;
	font-size: 13.5px;
	line-height: 1.45;
	margin-bottom: 18px;
}

#twine-login .tw-msg.error {
	background: #fbe6dd;
	color: #a3371a;
	border: 1px solid #f1c3b2;
}

#twine-login .tw-msg.note {
	background: var(--blue-wash);
	color: var(--blue-deep);
	border: 1px solid #c9d3ff;
}

#twine-login .tw-field {
	margin-bottom: 16px;
}

#twine-login .tw-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 7px;
	color: var(--ink);
}

#twine-login .tw-field input {
	width: 100%;
	padding: 13px 15px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--r-sm);
	background: var(--card);
	font-size: 15px;
	color: var(--ink);
	font-family: inherit;
	transition: border-color .15s, box-shadow .15s;
}

#twine-login .tw-field input:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 0 0 0 4px var(--blue-wash);
}

#twine-login .tw-formrow {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin: 4px 0 24px;
	font-size: 13.5px;
}

#twine-login .tw-formrow a {
	color: var(--blue);
	font-weight: 600;
}

#twine-login .tw-btn-primary {
	display: block;
	width: 100%;
	padding: 14px;
	border: none;
	border-radius: var(--r-sm);
	background: var(--blue);
	color: #fff;
	font-family: inherit;
	font-weight: 600;
	font-size: 15.5px;
	letter-spacing: -.01em;
	cursor: pointer;
	transition: transform .12s, background .15s, box-shadow .2s;
	box-shadow: 0 8px 20px -8px rgba(10, 72, 255, .6);
}

#twine-login .tw-btn-primary:hover {
	background: var(--blue-deep);
	transform: translateY(-1px);
}

#twine-login .tw-btn-primary:active {
	transform: translateY(0);
}

#twine-login .tw-create {
	margin-top: 18px;
	text-align: center;
	font-size: 13.5px;
}

#twine-login .tw-create a {
	color: var(--blue);
	font-weight: 600;
}

#twine-login .tw-foot {
	margin-top: 28px;
	font-size: 13px;
	color: var(--ink-faint);
	text-align: center;
}

#twine-login .tw-foot b {
	color: var(--ink-soft);
	font-weight: 600;
}

/* The support address links out to the help desk. Both selectors are needed:
   the shell's `a { color: inherit }` would leave the anchor looking like plain
   text, and the rule above would then repaint the <b> inside it grey again. */
#twine-login .tw-foot a,
#twine-login .tw-foot a b {
	color: var(--blue);
}

/* About / disclaimer */
#twine-login .tw-about {
	margin-top: 22px;
	font-size: 12px;
	color: var(--ink-faint);
	line-height: 1.5;
}

#twine-login .tw-about summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--ink-soft);
	list-style: none;
	text-align: center;
}

#twine-login .tw-about summary::-webkit-details-marker {
	display: none;
}

#twine-login .tw-about[open] summary {
	margin-bottom: 10px;
}

#twine-login .tw-about p {
	margin-bottom: 8px;
}

#twine-login .tw-about a {
	color: var(--blue);
}

/* ============ responsive ============ */
@media (max-width: 860px) {
	#twine-login {
		grid-template-columns: 1fr;
	}

	#twine-login .tw-brandpane {
		display: none;
	}
}
