/* Comics Studio login pages. Look: PHASE-1 UX §4.0 / §4.0a (redesign 2026-11-12): same tokens as the Studio app. */
@font-face { font-family: "Vedic Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/VedicSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Vedic Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/VedicSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "Vedic Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/VedicSans-Bold.woff2") format("woff2"); }
@font-face { font-family: "Vedic Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/VedicSans-ExtraBold.woff2") format("woff2"); }
@font-face { font-family: "Vedic Sans"; font-weight: 900; font-style: normal; font-display: swap; src: url("fonts/VedicSans-Black.woff2") format("woff2"); }

:root {
	--red: #EB1000;
	--blue: #3A63F9;
	--green: #0AA35B;
	--orange: #FFA311;
	--yellow: #F3C600;

	--paper: #FFF8EC;
	--surface: #FFFFFF;
	--sunken: #FBF4E6;
	--text: #17182E;
	--muted: #5F6178;
	--line: #EDE5D5;
	--field: #DCD3C2;
	--accent: #3A63F9;
	--accent-press: #2347D6;
	--on-accent: #FFFFFF;
	--ink: #17182E;
	--ink-shadow: #17182E;

	--green-tint: #DFF5E9;
	--orange-tint: #FFEFD6;
	--red-tint: #FFE5E1;

	--ok: #067A43;
	--bad: #C40D00;
	--dots-a: rgba(58, 99, 249, 0.22);
	--dots-b: rgba(235, 16, 0, 0.16);
	--dots-c: rgba(243, 198, 0, 0.45);

	--font: "Vedic Sans", system-ui, sans-serif;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #0E0F1C;
		--surface: #181A2D;
		--sunken: #121324;
		--text: #F3F2FA;
		--muted: #A4A7C0;
		--line: #26283F;
		--field: #34375A;
		--accent: #7E98FF;
		--accent-press: #6A86FF;
		--on-accent: #0B0D20;
		--ink: #F3F2FA;
		--ink-shadow: #04050C;
		--green-tint: #0F2C1E;
		--orange-tint: #33260C;
		--red-tint: #3A1411;
		--ok: #5EDB9C;
		--bad: #FF8A80;
		--dots-a: rgba(126, 152, 255, 0.22);
		--dots-b: rgba(255, 138, 128, 0.14);
		--dots-c: rgba(243, 198, 0, 0.22);
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }

html { background: var(--paper); -webkit-text-size-adjust: 100%; }

body {
	position: relative;
	margin: 0;
	min-height: 100vh;
	overflow-x: hidden;
	color: var(--text);
	font: 400 18px/1.55 var(--font);
	overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
}

/* Halftone splashes in three corners, like a printed comic page. */
body::before,
body::after {
	content: "";
	position: fixed;
	z-index: -1;
	pointer-events: none;
	width: 520px;
	height: 520px;
	background-size: 14px 14px;
	-webkit-mask-image: radial-gradient(circle, #000 0, transparent 68%);
	mask-image: radial-gradient(circle, #000 0, transparent 68%);
}
body::before {
	top: -220px;
	left: -200px;
	background-image: radial-gradient(var(--dots-a) 2.2px, transparent 2.8px);
}
body::after {
	right: -220px;
	bottom: -240px;
	background-image: radial-gradient(var(--dots-c) 2.4px, transparent 3px);
}

.login-wrap {
	position: relative;
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
	padding: 8vh 16px 48px;
}

/* Brand stripe above the logo. */
.login-wrap::before {
	content: "";
	display: block;
	width: 120px;
	height: 5px;
	margin: 0 auto 18px;
	border-radius: 999px;
	background: linear-gradient(90deg,
		var(--red) 0 20%, var(--orange) 20% 40%, var(--yellow) 40% 60%, var(--green) 60% 80%, var(--blue) 80% 100%);
}

.logo {
	margin: 0 0 24px;
	font-size: 28px;
	font-weight: 900;
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-align: center;
	white-space: nowrap;
}
.logo small {
	display: inline-block;
	margin-left: 10px;
	padding: 4px 10px;
	vertical-align: 5px;
	border-radius: 7px;
	background: var(--text);
	color: var(--paper);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
}
/* The site logo (Appearance → Customize → Site Identity), when one is set. */
.logo-img { display: block; width: 160px; height: auto; margin: 0 auto 20px; }
.logo .c1 { color: var(--blue); }
.logo .c2 { color: var(--red); }
.logo .c3 { color: var(--green); }
.logo .c4 { color: var(--orange); }

/* The card is a comic panel: ink outline and a hard shadow. */
.login-card {
	position: relative;
	padding: 32px 30px 30px;
	background: var(--surface);
	border: 2px solid var(--ink);
	border-radius: 26px;
	box-shadow: 6px 6px 0 var(--ink-shadow);
}

h1 {
	margin: 0 0 18px;
	font-size: 28px;
	line-height: 1.12;
	font-weight: 900;
	letter-spacing: -0.015em;
}

p { margin: 0; }

.muted { color: var(--muted); font-size: 18px; }

/* Speech bubble with a tail at the bottom left. */
.bubble {
	position: relative;
	margin: 0 0 26px;
	padding: 12px 18px;
	background: var(--sunken);
	color: var(--text);
	border: 2px solid var(--ink);
	border-radius: 20px;
	font-weight: 600;
	line-height: 1.45;
}
.bubble::after {
	content: "";
	position: absolute;
	left: 26px;
	bottom: -10px;
	width: 16px;
	height: 16px;
	background: inherit;
	border-right: 2px solid var(--ink);
	border-bottom: 2px solid var(--ink);
	transform: rotate(45deg) skew(10deg, 10deg);
}
.error.bubble { background: var(--red-tint); }
.notice.bubble { background: var(--orange-tint); }
.notice.ok.bubble { background: var(--green-tint); }

.login-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

label {
	font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"] {
	width: 100%;
	min-width: 0;
	height: 50px;
	margin: -4px 0 4px;
	padding: 0 16px;
	font: 500 18px var(--font);
	color: var(--text);
	background: var(--surface);
	border: 1.5px solid var(--field);
	border-radius: 14px;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

input.code-input {
	height: 64px;
	font-size: 30px;
	font-weight: 800;
	letter-spacing: 0.4em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 50px;
	padding: 0 24px;
	font: 800 18px var(--font);
	color: var(--text);
	background: var(--surface);
	border: 1.5px solid var(--field);
	border-radius: 999px;
	text-decoration: none;
	cursor: pointer;
	transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary {
	background: var(--accent);
	color: var(--on-accent);
	border-color: transparent;
	box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 6px 16px -8px var(--accent);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-press); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; box-shadow: none; cursor: not-allowed; }

.link {
	align-self: center;
	min-height: 32px;
	padding: 0;
	font: 700 18px var(--font);
	color: var(--accent);
	background: none;
	border: 0;
	cursor: pointer;
}
.link:hover { text-decoration: underline; }

a { color: var(--accent); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn { text-decoration: none; }
.login-form > a { align-self: center; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.check {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	font-weight: 600;
	cursor: pointer;
}
.check input {
	width: 22px;
	height: 22px;
	margin: 0;
	flex: none;
	accent-color: var(--accent);
}

/* "or" with a rule either side. */
.or {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--muted);
	font-size: 18px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.or::before,
.or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

details.pw summary {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	border: 1.5px solid var(--field);
	border-radius: 999px;
	font-weight: 800;
	cursor: pointer;
	list-style: none;
}
details.pw summary::-webkit-details-marker { display: none; }
details.pw summary:hover { border-color: var(--muted); }
details.pw .pw-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pw-row {
	display: flex;
	gap: 8px;
}
.pw-row input { flex: 1; margin: -4px 0 4px; }
.pw-row .btn {
	width: auto;
	flex: none;
	min-height: 50px;
	margin-top: -4px;
	padding: 0 18px;
}

/* Password open: the code button, its divider and the summary give way. */
.login-form:has(details.pw[open]) .code-only,
.login-form:has(details.pw[open]) .or,
.login-form:has(details.pw[open]) details.pw summary {
	display: none;
}

.login-form .code-only { order: 2; }
.login-form .remember { order: 3; }
.login-form .or { order: 4; }
.login-form details.pw { order: 5; }
.login-form:has(details.pw[open]) .remember { order: 9; }

.js-only { display: none; }
.js .js-only { display: inline-flex; }

.footer {
	margin: 22px 0 0;
	font-size: 18px;
	text-align: center;
	color: var(--muted);
}

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

@media (max-width: 767px) {
	body { font-size: 18px; }
	.login-wrap { padding: calc(env(safe-area-inset-top) + 5vh) 16px calc(env(safe-area-inset-bottom) + 32px); }
	.logo { font-size: 25px; margin-bottom: 20px; }
	.logo-img { width: 128px; margin-bottom: 16px; }
	h1 { font-size: 25px; }
	.login-card { padding: 24px 20px 22px; border-radius: 22px; box-shadow: 4px 4px 0 var(--ink-shadow); }
	body::before, body::after { width: 360px; height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
	.btn, input { transition: none; }
	.btn:active:not(:disabled) { transform: none; }
}
