/* ==========================================================================
   DengeCudi — Log in / Register / Forgot / Reset, and the create-post gate
   Loaded by king-theme.php on those templates (after king-feed.css).
   ========================================================================== */

:root {
	--ka-text: #0d0c22;
	--ka-body: #3f4350;
	--ka-muted: #6b6f7b;
	--ka-line: #e2e4e9;
	--ka-soft: #f5f6f8;
	--ka-surface: #fff;
	--ka-hover: #eceef2;
	--ka-brand: #e60023;
	--ka-brand-hover: #c4001e;
	--ka-ink: #0d0c22;
	--ka-ink-text: #fff;
}
html.king-night {
	--ka-text: #f5f5f7;
	--ka-body: #c9cbd3;
	--ka-muted: #9a9ea9;
	--ka-line: #2c2c37;
	--ka-soft: #24242e;
	--ka-surface: #1b1b23;
	--ka-hover: #2e2e3a;
	--ka-ink: #f5f5f7;
	--ka-ink-text: #0d0c22;
}

/* ---------- Page frame ---------- */
body.king-template-login .king-main,
body.king-template-register .king-main,
body.king-template-forgot .king-main,
body.king-template-reset .king-main {
	width: auto !important;
	float: none;
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
}

body .kn-authpage {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	width: min(1040px, calc(100% - 32px));
	min-height: 600px;
	margin: 36px auto 56px;
	background: var(--ka-surface);
	border: 1px solid var(--ka-line);
	border-radius: 24px;
	box-shadow: 0 24px 60px rgba(13, 12, 34, .08);
	overflow: hidden;
}

/* ---------- Side panel ---------- */
body .kn-auth-aside {
	position: relative;
	display: flex;
	align-items: flex-end;
	padding: 44px;
	background:
		radial-gradient(120% 80% at 0% 0%, rgba(230, 0, 35, .28) 0%, rgba(230, 0, 35, 0) 55%),
		radial-gradient(90% 70% at 100% 100%, rgba(250, 204, 21, .14) 0%, rgba(250, 204, 21, 0) 60%),
		#0d0c22;
	color: #fff;
	overflow: hidden;
}
body .kn-auth-aside::before {
	/* subtle topographic texture */
	content: "";
	position: absolute;
	inset: 0;
	background-image: repeating-radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .045) 0 1px, transparent 1px 22px);
	pointer-events: none;
}
body .kn-auth-aside-in { position: relative; z-index: 1; }
body .kn-auth-aside-brand {
	position: absolute;
	top: -400px;
	display: none;
}
body .kn-auth-aside-lead {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 650;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .66);
}
body .kn-auth-aside-title {
	margin: 0 0 26px;
	font-size: clamp(26px, 1rem + 1.4vw, 34px);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -.025em;
	color: #fff;
	text-wrap: balance;
}
body .kn-auth-aside-list {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}
body .kn-auth-aside-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 15px;
	line-height: 1.45;
	color: rgba(255, 255, 255, .86);
}
body .kn-auth-aside-list i {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 14px;
}

/* ---------- Form card ---------- */
body .kn-authpage .king-auth-card {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 44px 48px;
	background: var(--ka-surface);
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
body .kn-authpage .king-auth-page-header {
	margin: 0 0 26px;
	padding: 0;
	border: 0;
	text-align: left;
}
body .kn-authpage .king-auth-eyebrow { display: none; }
body .kn-authpage .king-auth-page-title {
	margin: 0;
	font-size: 30px;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -.025em;
	color: var(--ka-text);
}
body .kn-authpage .king-auth-page-intro {
	margin: 8px 0 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ka-muted);
}
body .kn-authpage .king-part-form,
body .kn-authpage .king-part-form.king-inner {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Table layout -> stacked fields */
body .kn-authpage .king-form-tall-table,
body .kn-authpage .king-form-tall-table tbody,
body .kn-authpage .king-form-tall-table tr,
body .kn-authpage .king-form-tall-table td {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}
body .kn-authpage .king-form-tall-label {
	margin: 0 0 7px;
	font-size: 13.5px;
	font-weight: 650;
	color: var(--ka-text);
}
body .kn-authpage .king-form-tall-data { margin: 0 0 18px; }
body .kn-authpage .king-form-tall-label:has(input[type="checkbox"]) { margin: 2px 0 20px; }
body .kn-authpage .king-form-tall-data:empty { display: none; }

body .kn-authpage input.king-form-tall-text {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	background: var(--ka-surface);
	border: 1px solid var(--ka-line);
	border-radius: 12px;
	box-shadow: none;
	color: var(--ka-text);
	-webkit-text-fill-color: var(--ka-text);
	font-size: 15.5px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
body .kn-authpage input.king-form-tall-text::placeholder { color: var(--ka-muted); -webkit-text-fill-color: var(--ka-muted); opacity: .8; }
body .kn-authpage input.king-form-tall-text:hover { border-color: color-mix(in srgb, var(--ka-text) 25%, var(--ka-line)); }
body .kn-authpage input.king-form-tall-text:focus {
	border-color: var(--ka-text);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ka-text) 10%, transparent);
}
body .kn-authpage input.king-form-tall-text:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 40px var(--ka-surface) inset;
	-webkit-text-fill-color: var(--ka-text);
}

/* Show / hide password */
body .kn-authpage .kn-pw { position: relative; display: block; }
body .kn-authpage .kn-pw input.king-form-tall-text { padding-right: 48px; }
body .kn-authpage .kn-pw-toggle {
	position: absolute;
	top: 50%;
	right: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -18px 0 0;
	padding: 0;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--ka-muted);
	font-size: 15px;
	cursor: pointer;
}
body .kn-authpage .kn-pw-toggle:hover { background: var(--ka-hover); color: var(--ka-text); }
body .kn-authpage .kn-pw-toggle:focus-visible { outline: 2px solid var(--ka-text); outline-offset: 1px; }

/* Notes, links and checkboxes */
body .kn-authpage .king-form-tall-data .king-form-tall-note {
	margin: 7px 0 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--ka-muted);
	text-align: left;
}
body .kn-authpage .king-form-tall-note a[href*="forgot"] {
	display: block;
	text-align: right;
	color: var(--ka-text);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
body .kn-authpage .king-form-tall-note a[href*="forgot"]:hover { text-decoration: underline; }
body .kn-authpage .king-form-tall-label label {
	position: relative;
	display: block;
	margin: 0;
	padding: 0 0 0 28px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
	color: var(--ka-body);
	cursor: pointer;
}
body .kn-authpage .king-form-tall-label label p { display: none; }
body .kn-authpage .king-form-tall-label label a {
	margin: 0;
	color: var(--ka-text);
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 2px;
}
body .kn-authpage .king-form-tall-checkbox {
	position: absolute;
	top: 1px;
	left: 0;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--ka-ink);
	cursor: pointer;
}
body .kn-authpage .king-recaptcha-wrap { margin: 2px 0 0; }

/* Errors */
body .kn-authpage .king-form-tall-error {
	display: block;
	margin: 7px 0 0;
	padding: 0;
	background: transparent;
	border: 0;
	color: #d92d20;
	font-size: 13px;
	font-weight: 600;
}
body .kn-authpage .king-form-tall-error:empty { display: none; }
body .kn-authpage .king-form-tall-data:has(.king-form-tall-error:not(:empty)) input.king-form-tall-text { border-color: #d92d20; }
body .kn-authpage .king-error,
body .king-auth-card .king-error {
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px solid color-mix(in srgb, #d92d20 30%, transparent);
	border-radius: 12px;
	background: color-mix(in srgb, #d92d20 8%, var(--ka-surface));
	color: #b42318;
	font-size: 14px;
	font-weight: 600;
	box-shadow: none;
}

/* Buttons */
body .kn-authpage .king-form-tall-buttons {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 16px;
	margin: 8px 0 0;
	text-align: center;
}
body .kn-authpage .king-form-tall-buttons br { display: none; }
body .kn-authpage input.king-form-tall-button {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 12px;
	background: var(--ka-brand);
	box-shadow: none;
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
}
body .kn-authpage input.king-form-tall-button:hover { background: var(--ka-brand-hover); }
body .kn-authpage input.king-form-tall-button:active { transform: scale(.99); }
body .kn-authpage input.king-form-tall-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--ka-brand) 40%, transparent); outline-offset: 2px; }
body .kn-authpage input.king-form-tall-button.is-busy,
body .kn-authpage input.king-form-tall-button:disabled { opacity: .65; cursor: progress; }

/* "New to DengeCudi? Create account" */
body .kn-authpage .king-form-tall-buttons > .king-form-tall-note {
	display: block;
	margin: 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--ka-line);
	font-size: 14px;
	color: var(--ka-muted);
	text-align: center;
}
body .kn-authpage .king-form-tall-buttons > .king-form-tall-note .king-auth-switch-copy { margin-right: 6px; }
body .kn-authpage .king-form-tall-buttons > .king-form-tall-note a,
body .kn-authpage .king-form-tall-buttons > .king-form-tall-note a.hllink {
	display: inline !important;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--ka-text);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}
body .kn-authpage .king-auth-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 22px 0 0;
	color: var(--ka-text);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
body .kn-authpage .king-auth-back:hover { text-decoration: underline; }

/* ---------- Create page: logged-out gate ---------- */
body.king-post-create-page .king-main:has(.kn-create-gate),
body.king-post-create-page .king-main.one-page .king-inner:has(.kn-create-gate) {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}
body .kn-create-gate {
	max-width: 520px;
	margin: 56px auto 72px;
	padding: 40px 36px;
	background: var(--ka-surface);
	border: 1px solid var(--ka-line);
	border-radius: 24px;
	box-shadow: 0 24px 60px rgba(13, 12, 34, .07);
	text-align: center;
}
body .kn-create-gate-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 0 18px;
	border-radius: 18px;
	background: color-mix(in srgb, var(--ka-brand) 10%, var(--ka-surface));
	color: var(--ka-brand);
	font-size: 26px;
}
body .kn-create-gate-title {
	margin: 0 0 10px;
	font-size: 26px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--ka-text);
}
body .kn-create-gate-text {
	max-width: 40ch;
	margin: 0 auto 26px;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--ka-muted);
}
body .kn-create-gate-actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
}
body .kn-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 150px;
	height: 46px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}
body .kn-btn--primary { background: var(--ka-brand); color: #fff; }
body .kn-btn--primary:hover { background: var(--ka-brand-hover); color: #fff; }
body .kn-btn--ghost { background: var(--ka-surface); border-color: var(--ka-line); color: var(--ka-text); }
body .kn-btn--ghost:hover { background: var(--ka-hover); color: var(--ka-text); }

/* ---------- Dark mode: beat the theme's own .king-night rules ---------- */
html.king-night body .kn-authpage,
html.king-night body .kn-authpage .king-auth-card,
html.king-night body .kn-create-gate {
	background: var(--ka-surface);
	border-color: var(--ka-line);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
html.king-night body .kn-authpage .king-auth-card { box-shadow: none; }
html.king-night body .kn-auth-aside {
	background:
		radial-gradient(120% 80% at 0% 0%, rgba(230, 0, 35, .3) 0%, rgba(230, 0, 35, 0) 55%),
		radial-gradient(90% 70% at 100% 100%, rgba(250, 204, 21, .12) 0%, rgba(250, 204, 21, 0) 60%),
		#101018;
}
html.king-night body .kn-authpage input.king-form-tall-text {
	background: var(--ka-soft);
	border-color: var(--ka-line);
	color: var(--ka-text);
	-webkit-text-fill-color: var(--ka-text);
}
html.king-night body .kn-authpage input.king-form-tall-text:focus { border-color: var(--ka-text); }
html.king-night body .kn-authpage .king-form-tall-note a[href*="forgot"],
html.king-night body .kn-authpage .king-form-tall-buttons > .king-form-tall-note a,
html.king-night body .kn-authpage .king-form-tall-label label a,
html.king-night body .kn-authpage .king-form-tall-label,
html.king-night body .kn-authpage .king-auth-page-title { color: var(--ka-text); }
html.king-night body .kn-authpage input.king-form-tall-text:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--ka-soft) inset; }

/* ---------- Tablet / phone ---------- */
@media (max-width: 991px) {
	body .kn-authpage {
		grid-template-columns: 1fr;
		width: min(520px, calc(100% - 24px));
		min-height: 0;
		margin: 20px auto 40px;
	}
	body .kn-auth-aside { display: none; }
	body .kn-authpage .king-auth-card { padding: 32px 28px; }
}
@media (max-width: 560px) {
	body .kn-authpage {
		width: 100%;
		margin: 0 0 24px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
	}
	html.king-night body .kn-authpage { background: transparent; box-shadow: none; }
	body .kn-authpage .king-auth-card,
	html.king-night body .kn-authpage .king-auth-card { padding: 24px 18px 8px; background: transparent; }
	body .kn-authpage .king-auth-page-header { margin-bottom: 22px; }
	body .kn-authpage .king-auth-page-title { font-size: 26px; }
	/* 16px stops iOS zooming into the field */
	body .kn-authpage input.king-form-tall-text { height: 50px; font-size: 16px; }
	body .kn-authpage .king-recaptcha-wrap { transform-origin: 0 0; }
	body .kn-create-gate {
		margin: 24px 14px 40px;
		padding: 30px 20px;
		border-radius: 20px;
	}
	body .kn-create-gate-actions { flex-direction: column; }
	body .kn-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	body .kn-authpage input.king-form-tall-button { transition: none; }
}
