/**
 * Resident Portal — Public Styles
 *
 * Phase 1: foundation only.
 * Phase 4: Authentication UI (Login, Register, Forgot/Reset Password).
 *
 * Design language: a "building access" motif — deep pine-teal as the
 * trust/verified color, a warm clay accent used sparingly, and a serif
 * display face for headings paired with the system UI sans for body
 * copy and controls. No external font loading (keeps the plugin
 * portable and avoids third-party font CDN privacy concerns) — the
 * serif stack degrades gracefully to Georgia where the named face isn't
 * installed.
 */

.rp-auth {
	--rp-color-bg: #eef2f1;
	--rp-color-surface: #ffffff;
	--rp-color-ink: #1b2430;
	--rp-color-ink-muted: #5b6670;
	--rp-color-accent: #2f6f5e;
	--rp-color-accent-dark: #234f43;
	--rp-color-accent-warm: #c97b3d;
	--rp-color-border: #dce1de;
	--rp-color-error: #a83b2a;
	--rp-color-error-bg: #fbeae6;
	--rp-color-success: #2f6f5e;
	--rp-color-success-bg: #e7f1ee;
	--rp-font-display: Fraunces, Georgia, 'Iowan Old Style', serif;
	--rp-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	width: 100%;
	padding: 48px 20px;
	background-color: var(--rp-color-bg);
	font-family: var(--rp-font-body);
	color: var(--rp-color-ink);
}

.rp-auth *,
.rp-auth *::before,
.rp-auth *::after {
	box-sizing: border-box;
}

.rp-auth-card {
	display: flex;
	width: 100%;
	max-width: 920px;
	background-color: var(--rp-color-surface);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(27, 36, 48, 0.04), 0 12px 32px rgba(27, 36, 48, 0.08);
	border: 1px solid var(--rp-color-border);
}

.rp-auth-card--narrow {
	max-width: 440px;
}

/* --- Signature side panel (Login / Register only) ------------------- */

.rp-auth-side {
	position: relative;
	flex: 0 0 38%;
	background-color: var(--rp-color-accent-dark);
	background-image: repeating-linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.035) 0px,
		rgba(255, 255, 255, 0.035) 1px,
		transparent 1px,
		transparent 28px
	);
	color: #f2f6f4;
	padding: 40px 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.rp-auth-side-inner {
	max-width: 260px;
}

.rp-auth-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.12);
	color: var(--rp-color-accent-warm);
	margin-bottom: 20px;
}

.rp-auth-eyebrow {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--rp-color-accent-warm);
	margin: 0 0 10px;
}

.rp-auth-side-headline {
	font-family: var(--rp-font-display);
	font-size: 1.65rem;
	line-height: 1.28;
	font-weight: 600;
	margin: 0 0 24px;
	color: #ffffff;
}

.rp-auth-feature-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rp-auth-feature-list li {
	position: relative;
	padding-left: 22px;
	font-size: 0.9rem;
	line-height: 1.5;
	color: rgba(242, 246, 244, 0.88);
}

.rp-auth-feature-list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 7px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--rp-color-accent-warm);
}

/* --- Form panel ------------------------------------------------------ */

.rp-auth-panel {
	flex: 1 1 auto;
	padding: 44px 40px;
	min-width: 0;
}

.rp-auth-title {
	font-family: var(--rp-font-display);
	font-size: 1.9rem;
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--rp-color-ink);
}

.rp-auth-subtitle {
	font-size: 0.94rem;
	color: var(--rp-color-ink-muted);
	margin: 0 0 26px;
}

.rp-auth-footer {
	margin: 24px 0 0;
	font-size: 0.9rem;
	color: var(--rp-color-ink-muted);
	text-align: center;
}

/* --- Notices ----------------------------------------------------------- */

.rp-notice {
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 0.88rem;
	line-height: 1.5;
	margin-bottom: 20px;
}

.rp-notice--error {
	background-color: var(--rp-color-error-bg);
	color: var(--rp-color-error);
	border: 1px solid rgba(168, 59, 42, 0.18);
}

.rp-notice--success {
	background-color: var(--rp-color-success-bg);
	color: var(--rp-color-accent-dark);
	border: 1px solid rgba(47, 111, 94, 0.18);
}

/* --- Form elements ------------------------------------------------------ */

.rp-auth-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.rp-field-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.rp-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rp-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--rp-color-ink);
}

.rp-input {
	appearance: none;
	width: 100%;
	padding: 11px 14px;
	font-size: 0.95rem;
	font-family: var(--rp-font-body);
	color: var(--rp-color-ink);
	background-color: #fbfbfa;
	border: 1px solid var(--rp-color-border);
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rp-input:hover {
	border-color: #c3ccc8;
}

.rp-input:focus {
	outline: none;
	border-color: var(--rp-color-accent);
	box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.15);
	background-color: #ffffff;
}

.rp-input--file {
	padding: 8px 10px;
	background-color: #fbfbfa;
}

.rp-hint {
	font-size: 0.78rem;
	color: var(--rp-color-ink-muted);
}

.rp-field-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

.rp-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 0.85rem;
	color: var(--rp-color-ink-muted);
	cursor: pointer;
	line-height: 1.4;
}

.rp-checkbox input[type='checkbox'] {
	margin-top: 2px;
	accent-color: var(--rp-color-accent);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.rp-link {
	color: var(--rp-color-accent);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.86rem;
}

.rp-link:hover,
.rp-link:focus-visible {
	text-decoration: underline;
}

/* --- Buttons ------------------------------------------------------------ */

.rp-btn {
	appearance: none;
	border: none;
	border-radius: 8px;
	font-family: var(--rp-font-body);
	font-size: 0.95rem;
	font-weight: 600;
	padding: 12px 22px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.05s ease;
}

.rp-btn--primary {
	background-color: var(--rp-color-accent);
	color: #ffffff;
}

.rp-btn--primary:hover {
	background-color: var(--rp-color-accent-dark);
}

.rp-btn--primary:active {
	transform: translateY(1px);
}

.rp-btn--primary:focus-visible {
	outline: 2px solid var(--rp-color-accent-dark);
	outline-offset: 2px;
}

.rp-btn--block {
	width: 100%;
}

.rp-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 760px) {
	.rp-auth {
		padding: 24px 16px;
	}

	.rp-auth-card--split {
		flex-direction: column;
	}

	.rp-auth-side {
		flex: none;
		padding: 28px 24px;
	}

	.rp-auth-side-inner {
		max-width: none;
	}

	.rp-auth-feature-list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 10px 20px;
	}

	.rp-auth-panel {
		padding: 32px 24px;
	}

	.rp-field-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 420px) {
	.rp-auth-title {
		font-size: 1.6rem;
	}
}

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.rp-auth .rp-btn,
	.rp-auth .rp-input {
		transition: none;
	}

	.rp-auth-card {
		animation: none;
	}
}

/* --- Entrance animation ----------------------------------------------------
 * A subtle, one-time fade/slide on load — skipped entirely for anyone with
 * prefers-reduced-motion set (see above), and harmless if JS is disabled
 * since it's pure CSS with no dependency on script execution. */

@keyframes rp-fade-in-up {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.rp-auth-card {
	animation: rp-fade-in-up 0.4s ease-out;
}

/* --- Dark/Light ready CSS architecture --------------------------------------
 * Every color here is already a CSS custom property (see .rp-auth above),
 * so a dark palette is just a matter of overriding those same variable
 * names for users whose OS/browser requests it — no separate dark
 * stylesheet or structural change needed. Falls back to the light palette
 * automatically for anyone without a preference set. */

@media (prefers-color-scheme: dark) {
	.rp-auth {
		--rp-color-bg: #14181a;
		--rp-color-surface: #1e2427;
		--rp-color-ink: #eef1ef;
		--rp-color-ink-muted: #9aa39d;
		--rp-color-accent: #4a9c85;
		--rp-color-accent-dark: #6fc2a8;
		--rp-color-accent-warm: #d99a63;
		--rp-color-border: #2c3336;
		--rp-color-error: #e8877a;
		--rp-color-error-bg: #3a2420;
		--rp-color-success: #4a9c85;
		--rp-color-success-bg: #1c2e29;
	}

	.rp-auth-card {
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
	}
}

