/**
 * CDS Auth — front-end login + registration forms.
 *
 * A standalone, centered card themed by [data-theme] using the same design
 * tokens as the dashboard, so login/register match the app on dark and light.
 */
.cds-auth {
	/* Shared accents */
	--accent: #2563eb;
	--brand: #f97316;
	--ok: #16a34a;
	--crit: #ef4444;

	/* DARK default */
	--bg: #0b1220;
	--surface: #111c33;
	--surface-2: #1b2942;
	--line: #27395c;
	--text: #e8eef7;
	--muted: #93a2bd;
	--accent-soft: rgba(37, 99, 235, .15);

	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70vh;
	padding: 28px 16px;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}

.cds-auth[data-theme="light"] {
	--bg: #f8fafc;
	--surface: #ffffff;
	--surface-2: #f1f5f9;
	--line: #e6eaf0;
	--text: #1e293b;
	--muted: #64748b;
	--accent-soft: #eff4ff;
}

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

.cds-auth__card {
	width: 100%;
	max-width: 420px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 30px 28px 26px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}

.cds-auth__brand { text-align: center; margin-bottom: 14px; }
.cds-auth__logo { max-width: 180px; max-height: 64px; height: auto; width: auto; }
.cds-auth__wordmark { font-size: 20px; font-weight: 800; letter-spacing: .01em; color: var(--text); }

.cds-auth__title { margin: 4px 0 4px; font-size: 22px; font-weight: 700; text-align: center; color: var(--text); }
.cds-auth__sub { margin: 0 0 18px; font-size: 13px; text-align: center; color: var(--muted); }

.cds-auth__form { display: block; }

.cds-auth__err {
	margin: 0 0 14px;
	padding: 10px 13px;
	font-size: 13px;
	line-height: 1.45;
	color: #fff;
	background: var(--crit);
	border-radius: 10px;
}

.cds-auth__row { display: flex; gap: 12px; }
.cds-auth__row .cds-auth__field { flex: 1 1 0; min-width: 0; }

.cds-auth__field { margin-bottom: 14px; }
.cds-auth__field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cds-auth__field input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text);
	font-size: 14px;
}
.cds-auth__field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cds-auth__field input::placeholder { color: var(--muted); opacity: .7; }

.cds-auth__pwwrap { position: relative; }
.cds-auth__pwwrap input { padding-right: 44px; }
.cds-auth__pwtoggle {
	position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
	background: transparent; border: 0; cursor: pointer;
	font-size: 16px; line-height: 1; padding: 7px; border-radius: 8px;
	opacity: .65;
}
.cds-auth__pwtoggle:hover { opacity: 1; }

.cds-auth__remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.cds-auth__remember input { width: auto; }

.cds-auth__rules { list-style: none; margin: 0 0 16px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.cds-auth__rules li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 2px 0; }
.cds-auth__rmark { display: inline-flex; width: 16px; justify-content: center; font-weight: 700; color: var(--crit); }
.cds-auth__rules li.is-ok { color: var(--text); }
.cds-auth__rules li.is-ok .cds-auth__rmark { color: var(--ok); }

.cds-auth__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%;
	padding: 12px 16px;
	background: var(--accent);
	color: #fff;
	border: 0;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}
.cds-auth__btn:hover { filter: brightness(1.06); }
.cds-auth__btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }

.cds-auth__spin { width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: cds-auth-spin .7s linear infinite; }
@keyframes cds-auth-spin { to { transform: rotate(360deg); } }

.cds-auth__alt { margin: 14px 0 0; font-size: 13px; text-align: center; color: var(--muted); }
.cds-auth__alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.cds-auth__alt a:hover { text-decoration: underline; }

@media (max-width: 480px) {
	.cds-auth__card { padding: 24px 18px 22px; border-radius: 14px; }
	.cds-auth__row { flex-direction: column; gap: 0; }
}
