/* =========================================================
   Custom Dashboard — giao diện xác thực & thành phần dùng chung
   ========================================================= */

:root {
	--cd-primary: #2563eb;
	--cd-primary-dark: #1d4ed8;
	--cd-primary-soft: rgba(37, 99, 235, .12);
	--cd-radius: 14px;
	--cd-text: #0f172a;
	--cd-muted: #64748b;
	--cd-border: #e2e8f0;
	--cd-bg: #f1f5f9;
	--cd-surface: #ffffff;
	--cd-danger: #dc2626;
	--cd-success: #15803d;
	--cd-warning: #b45309;
	--cd-shadow: 0 10px 30px rgba(15, 23, 42, .08);
	--cd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* ---------- Bố cục ---------- */

.cd-auth {
	display: grid;
	grid-template-columns: 1fr;
	min-height: min(760px, 88vh);
	font-family: var(--cd-font);
	color: var(--cd-text);
	background: var(--cd-bg);
	border-radius: var(--cd-radius);
	overflow: hidden;
}

.cd-auth--split {
	grid-template-columns: 1.05fr 1fr;
}

@media (max-width: 900px) {
	.cd-auth--split {
		grid-template-columns: 1fr;
	}
}

.cd-auth__cover {
	position: relative;
	display: flex;
	align-items: center;
	padding: 48px;
	color: #fff;
	background-color: var(--cd-primary);
	background-size: cover;
	background-position: center;
}

.cd-auth__cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--cd-primary) 0%, var(--cd-primary-dark) 100%);
	opacity: .92;
}

.cd-auth__cover-inner {
	position: relative;
	z-index: 1;
	max-width: 420px;
}

.cd-auth__brand img {
	max-height: 44px;
	width: auto;
}

.cd-auth__brand-text {
	font-size: 26px;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
}

.cd-auth__brand {
	text-decoration: none;
	display: inline-block;
	margin-bottom: 24px;
}

.cd-auth__tagline {
	font-size: 20px;
	line-height: 1.55;
	margin: 0 0 26px;
	opacity: .95;
}

.cd-auth__points {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}

.cd-auth__points li {
	position: relative;
	padding-left: 28px;
	font-size: 14.5px;
	opacity: .92;
}

.cd-auth__points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 6px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .25);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7);
}

@media (max-width: 900px) {
	.cd-auth__cover {
		display: none;
	}
}

.cd-auth__main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 44px 20px;
}

.cd-auth__card {
	width: 100%;
	max-width: 430px;
	background: var(--cd-surface);
	border: 1px solid var(--cd-border);
	border-radius: calc(var(--cd-radius) + 4px);
	box-shadow: var(--cd-shadow);
	padding: 34px 32px;
}

.cd-auth__logo img {
	max-height: 42px;
	margin-bottom: 18px;
}

.cd-auth__title {
	margin: 0 0 6px;
	font-size: 25px;
	line-height: 1.3;
	font-weight: 700;
}

.cd-auth__subtitle {
	margin: 0 0 22px;
	color: var(--cd-muted);
	font-size: 14.5px;
	line-height: 1.6;
}

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

.cd-auth__footnote {
	margin: 18px 0 0;
	font-size: 13px;
}

.cd-auth__footnote a,
.cd-link {
	color: var(--cd-primary);
	text-decoration: none;
}

.cd-auth__footnote a:hover,
.cd-link:hover {
	text-decoration: underline;
}

.cd-link--sm {
	font-size: 13px;
}

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

.cd-form {
	display: grid;
	gap: 16px;
}

.cd-field {
	display: grid;
	gap: 6px;
}

.cd-field__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.cd-field label,
.cd-field > label {
	font-size: 13.5px;
	font-weight: 600;
	color: #334155;
}

.cd-optional {
	font-weight: 400;
	color: var(--cd-muted);
}

.cd-auth input[type="text"],
.cd-auth input[type="email"],
.cd-auth input[type="password"],
.cd-auth input[type="tel"],
.cd-auth input[type="url"],
.cd-auth textarea,
.cd-dash input[type="text"],
.cd-dash input[type="email"],
.cd-dash input[type="password"],
.cd-dash input[type="tel"],
.cd-dash input[type="url"],
.cd-dash textarea,
.cd-dash select {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--cd-text);
	background: #fff;
	border: 1px solid var(--cd-border);
	border-radius: calc(var(--cd-radius) - 4px);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.cd-auth input:focus,
.cd-auth textarea:focus,
.cd-dash input:focus,
.cd-dash textarea:focus,
.cd-dash select:focus {
	outline: none;
	border-color: var(--cd-primary);
	box-shadow: 0 0 0 4px var(--cd-primary-soft);
}

.cd-hint {
	font-size: 12.5px;
	color: var(--cd-muted);
	line-height: 1.5;
}

.cd-hint--error {
	color: var(--cd-danger);
}

.cd-note {
	margin: 0;
	font-size: 13px;
	color: var(--cd-muted);
	text-align: center;
}

.cd-check {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 14px;
	color: #334155;
	cursor: pointer;
}

.cd-check input {
	margin-top: 2px;
	width: 16px;
	height: 16px;
	accent-color: var(--cd-primary);
}

/* Bẫy bot */
.cd-hp {
	position: absolute !important;
	left: -9999px !important;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

/* Ô mật khẩu */
.cd-password {
	position: relative;
}

.cd-password input {
	padding-right: 44px !important;
}

.cd-password__toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: var(--cd-muted);
	cursor: pointer;
	border-radius: 8px;
}

.cd-password__toggle:hover {
	background: var(--cd-bg);
	color: var(--cd-primary);
}

.cd-icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.cd-icon--sm {
	width: 17px;
	height: 17px;
}

/* Thanh đo độ mạnh mật khẩu */
.cd-strength__bar {
	height: 6px;
	border-radius: 999px;
	background: var(--cd-border);
	overflow: hidden;
}

.cd-strength__bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	transition: width .25s ease, background .25s ease;
}

.cd-strength[data-level="1"] .cd-strength__bar span { width: 33%; background: var(--cd-danger); }
.cd-strength[data-level="2"] .cd-strength__bar span { width: 66%; background: #f59e0b; }
.cd-strength[data-level="3"] .cd-strength__bar span { width: 100%; background: var(--cd-success); }

.cd-strength__label {
	display: block;
	margin-top: 4px;
	font-size: 12.5px;
	color: var(--cd-muted);
}

/* ---------- Nút ---------- */

.cd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: calc(var(--cd-radius) - 4px);
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}

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

.cd-btn--primary {
	background: var(--cd-primary);
	color: #fff;
}

.cd-btn--primary:hover {
	background: var(--cd-primary-dark);
	color: #fff;
}

.cd-btn--ghost {
	background: #fff;
	color: var(--cd-text);
	border-color: var(--cd-border);
}

.cd-btn--ghost:hover {
	border-color: var(--cd-primary);
	color: var(--cd-primary);
}

.cd-btn--link {
	background: transparent;
	color: var(--cd-muted);
	padding-left: 6px;
	padding-right: 6px;
}

.cd-btn--link:hover {
	color: var(--cd-danger);
}

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

.cd-btn--sm {
	padding: 8px 14px;
	font-size: 13.5px;
}

.cd-btn--google {
	width: 100%;
	background: #fff;
	color: #1f2937;
	border-color: var(--cd-border);
	font-weight: 600;
}

.cd-btn--google:hover {
	background: #f8fafc;
	color: #1f2937;
}

.cd-divider {
	position: relative;
	text-align: center;
	margin: 18px 0;
}

.cd-divider::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: var(--cd-border);
}

.cd-divider span {
	position: relative;
	padding: 0 12px;
	background: var(--cd-surface);
	color: var(--cd-muted);
	font-size: 13px;
}

.cd-stack {
	display: grid;
	gap: 12px;
}

.cd-inline-form {
	display: inline-block;
	margin: 0;
}

/* ---------- Thông báo ---------- */

.cd-alert {
	margin: 0 0 16px;
	padding: 12px 15px;
	border-radius: calc(var(--cd-radius) - 4px);
	font-size: 14px;
	line-height: 1.6;
	border: 1px solid transparent;
}

.cd-alert a {
	font-weight: 600;
}

.cd-alert--error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.cd-alert--success {
	background: #f0fdf4;
	border-color: #bbf7d0;
	color: #166534;
}

.cd-alert--warning {
	background: #fffbeb;
	border-color: #fde68a;
	color: #92400e;
}

.cd-alert--info {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #1e40af;
}

/* Khối user nhỏ cho header theme */
.cd-user-chip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--cd-font);
}

.cd-user-chip img {
	border-radius: 50%;
}

.cd-user-chip__name {
	font-weight: 600;
	color: var(--cd-text);
	text-decoration: none;
}

/* ---------- Chế độ toàn màn hình (không dùng layout theme) ---------- */

body.cd-standalone {
	margin: 0;
	padding: 0;
	background: var(--cd-bg);
	font-family: var(--cd-font);
}

/* Dọn thẻ rỗng do wpautop sinh ra quanh shortcode */
body.cd-standalone > p:empty,
body.cd-standalone > br {
	display: none;
}

.cd-standalone .cd-auth,
.cd-standalone .cd-dash {
	border-radius: 0;
	min-height: 100vh;
}

body.cd-standalone.admin-bar .cd-auth,
body.cd-standalone.admin-bar .cd-dash {
	min-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
	body.cd-standalone.admin-bar .cd-auth,
	body.cd-standalone.admin-bar .cd-dash {
		min-height: calc(100vh - 46px);
	}
}
