@font-face { font-family: "Averia Serif Libre"; src: url("../fonts/AveriaSerifLibre-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Averia Serif Libre"; src: url("../fonts/AveriaSerifLibre-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root
{
	color-scheme: dark;
	--page-bg: #09090B;
	--field: #0D0D10;
	--line: #2C2C31;
	--text-main: #F2F5ED;
	--text-muted: #AAB4A4;
	--text-soft: #D9E0D2;
	--kiwi: #B4D59E;
	--green: #94C17A;
	--rose: #D98982;
	--focus-ring: #D8F3C5;
	--display: "Averia Serif Libre", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; -webkit-text-size-adjust: 100%; }

body
{
	min-height: 100%;
	margin: 0;
	background: var(--page-bg);
	color: var(--text-main);
	font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

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

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

.mail-entry
{
	display: grid;
	grid-template-columns: minmax(420px, 1fr) 1fr;
	min-height: 100dvh;
}

.mail-form
{
	display: flex;
	flex-direction: column;
	padding: clamp(24px, 4vw, 48px) clamp(24px, 6vw, 96px);
}

.mail-brand
{
	display: inline-flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	color: var(--text-main);
	font: 700 1.3rem/1 var(--display);
	text-decoration: none;
}

.mail-form-body
{
	width: 100%;
	max-width: 420px;
	margin: auto;
	padding: 48px 0;
}

h1, h2
{
	margin: 0;
	font-family: var(--display);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	text-wrap: balance;
}

h1 { margin-bottom: 28px; font-size: clamp(1.9rem, 2.6vw, 2.4rem); }

#kiwi-login table,
#kiwi-login tbody,
#kiwi-login tr,
#kiwi-login td { display: block; width: 100%; padding: 0; border: 0; }
#kiwi-login tr { margin-bottom: 18px; }

#kiwi-login label
{
	display: block;
	margin-bottom: 7px;
	color: var(--text-soft);
	font-size: 0.9rem;
}

.mail-field { position: relative; display: block; }

.mail-input
{
	width: 100%;
	height: 52px;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--field);
	color: var(--text-main);
	font: inherit;
	transition: border-color 0.15s;
}

.mail-input:hover { border-color: #45454C; }
.mail-input:focus { border-color: var(--green); outline: 1px solid var(--green); outline-offset: 0; }
.mail-input:-webkit-autofill { -webkit-text-fill-color: var(--text-main); box-shadow: inset 0 0 0 60px var(--field); }
.mail-field .mail-input { padding-right: 54px; }

.mail-eye
{
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--text-muted);
	cursor: pointer;
	place-items: center;
}

.mail-eye:hover { color: var(--text-main); }
.mail-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mail-eye[aria-pressed="false"] .slash { display: none; }

#kiwi-login { display: flex; flex-direction: column; }
#kiwi-login .formbuttons { order: 3; margin: 0; }

.mail-forgot { order: 2; margin: -4px 0 22px; color: var(--text-muted); font-size: 0.92rem; }
.mail-forgot summary { display: inline-block; color: var(--kiwi); cursor: pointer; list-style: none; }
.mail-forgot summary::-webkit-details-marker { display: none; }
.mail-forgot summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.mail-forgot p { margin: 8px 0 0; }

#rcmloginsubmit
{
	width: 100%;
	height: 52px;
	border: 0;
	border-radius: 10px;
	background: var(--kiwi);
	color: #12180E;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
	transition: background 0.15s;
}

#rcmloginsubmit:hover { background: #C6E3B3; }
#rcmloginsubmit:disabled { opacity: 0.6; cursor: default; }

#mail-back
{
	margin-top: 20px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text-muted);
	font: inherit;
	font-size: 0.92rem;
	cursor: pointer;
}

#mail-back:hover { color: var(--text-main); }
.mail-note { max-width: 420px; width: 100%; margin: 0 auto; color: #8B9486; font-size: 0.85rem; }

.mail-chooser h1 { margin-bottom: 20px; }
.mail-chooser ul { margin: 0; padding: 0; list-style: none; }
.mail-chooser li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }

.mail-choice
{
	display: flex;
	flex: 1;
	align-items: center;
	gap: 14px;
	min-width: 0;
	min-height: 68px;
	padding: 10px 4px;
	border: 0;
	background: none;
	color: var(--text-main);
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.mail-choice:hover strong { color: var(--kiwi); }
.mail-choice-text { min-width: 0; line-height: 1.35; }
.mail-choice-text strong, .mail-choice-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-choice-text strong { font-weight: 600; transition: color 0.15s; }
.mail-choice-text span { color: var(--text-muted); font-size: 0.9rem; }

.mail-avatar
{
	display: grid;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #24331B;
	color: var(--kiwi);
	font: 700 1.1rem/1 var(--display);
	place-items: center;
}

.mail-avatar-add { background: none; border: 1px solid var(--line); color: var(--text-muted); }
.mail-forget { margin: 0; }
.mail-forget button { min-height: 44px; padding: 0 4px 0 12px; border: 0; background: none; color: #8B9486; font: inherit; font-size: 0.88rem; cursor: pointer; }
.mail-forget button:hover { color: var(--rose); }

.mail-story
{
	display: flex;
	padding: 40px;
	background:
		radial-gradient(90% 75% at 100% 105%, rgba(148, 193, 122, 0.42), rgba(148, 193, 122, 0.12) 45%, transparent 72%),
		#0D0F0C;
}

.mail-kiwi
{
	width: min(62%, 520px);
	height: auto;
	margin: auto;
}

#messagestack { position: fixed; z-index: 5; top: 20px; left: 50%; width: min(92vw, 420px); transform: translateX(-50%); }
#messagestack div { margin-bottom: 8px; padding: 13px 18px; border-radius: 10px; background: #1E2A17; color: var(--text-main); font-size: 0.95rem; }
#messagestack div.warning, #messagestack div.error { background: #3A1F1C; }
#messagestack .voice { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#messagestack a { color: inherit; }

@media (max-width: 960px)
{
	.mail-entry { grid-template-columns: 1fr; }
	.mail-story { display: none; }
	.mail-form { background: radial-gradient(120% 45% at 100% 106%, rgba(148, 193, 122, 0.3), transparent 72%); }
	.mail-form-body, .mail-note { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce)
{
	* { transition: none !important; }
}
