/**
 * KatCanDo Quotes — account, sign-in, registration and submission forms.
 * Inherits the theme's fonts and colours wherever possible.
 */

.kcd-account,
.kcd-acc-card,
.kcd-submit-form {
	--kcd-acc-line: color-mix(in srgb, currentColor 14%, transparent);
	--kcd-acc-soft: color-mix(in srgb, currentColor 5%, transparent);
	--kcd-acc-accent: var(--wp--preset--color--contrast, #111827);
	box-sizing: border-box;
}

.kcd-account *,
.kcd-acc-card *,
.kcd-submit-form * {
	box-sizing: border-box;
}

.kcd-acc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	gap: 2rem;
}

.kcd-acc-card,
.kcd-submit-form {
	padding: 1.5rem;
	border: 1px solid var(--kcd-acc-line);
	border-radius: 0.9rem;
	background: var(--kcd-acc-soft);
}

.kcd-acc-card p,
.kcd-submit-form p {
	margin: 0 0 1rem;
}

.kcd-acc-card label,
.kcd-submit-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.92em;
}

.kcd-acc-card input[type="text"],
.kcd-acc-card input[type="email"],
.kcd-acc-card input[type="password"],
.kcd-submit-form input[type="text"],
.kcd-submit-form input[type="email"],
.kcd-submit-form textarea,
.kcd-submit-form select,
.kcd-login input[type="text"],
.kcd-login input[type="password"] {
	width: 100%;
	padding: 0.65rem 0.8rem;
	border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
	border-radius: 0.55rem;
	background: Canvas;
	color: CanvasText;
	font: inherit;
}

.kcd-acc-card input:focus-visible,
.kcd-submit-form :is(input, textarea, select):focus-visible {
	outline: 2px solid var(--kcd-acc-accent);
	outline-offset: 1px;
}

.kcd-acc-check {
	display: flex !important;
	gap: 0.5rem;
	align-items: center;
	font-weight: 400 !important;
}

.kcd-acc-btn,
.kcd-login input[type="submit"],
.kcd-submit-form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.7rem 1.3rem;
	border: 0;
	border-radius: 999px;
	background: var(--kcd-acc-accent);
	color: var(--wp--preset--color--base, #fff);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.kcd-acc-btn-ghost {
	background: transparent;
	color: inherit;
	border: 1px solid var(--kcd-acc-line);
}

.kcd-acc-small,
.kcd-acc-note {
	font-size: 0.9em;
	opacity: 0.8;
}

.kcd-acc-error,
.kcd-acc-success {
	padding: 0.75rem 1rem;
	border-radius: 0.6rem;
	font-weight: 500;
}

.kcd-acc-error {
	background: #fde8e8;
	color: #9b1c1c;
}

.kcd-acc-success {
	background: #def7ec;
	color: #03543f;
}

.kcd-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Member header */
.kcd-acc-head {
	display: flex;
	gap: 1rem;
	align-items: center;
	margin-bottom: 1.5rem;
}

.kcd-acc-head img {
	border-radius: 50%;
}

.kcd-acc-head h2 {
	margin: 0;
}

.kcd-acc-level {
	margin: 0.2rem 0 0;
	opacity: 0.8;
}

.kcd-acc-logout {
	margin-left: auto;
	font-size: 0.9em;
}

.kcd-acc-section {
	margin-top: 2rem;
}

.kcd-acc-cta {
	margin-top: 1.5rem;
}

/* Stats */
.kcd-acc-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 0.75rem;
}

.kcd-acc-stat {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 1rem;
	border: 1px solid var(--kcd-acc-line);
	border-radius: 0.8rem;
	background: var(--kcd-acc-soft);
}

.kcd-acc-stat-ico {
	font-size: 1.4rem;
}

.kcd-acc-stat strong {
	font-size: 1.6rem;
	line-height: 1.1;
}

.kcd-acc-stat span:last-child {
	font-size: 0.85em;
	opacity: 0.75;
}

/* Badges */
.kcd-badges {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kcd-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding: 1rem 0.75rem;
	border: 1px dashed var(--kcd-acc-line);
	border-radius: 0.8rem;
	text-align: center;
	opacity: 0.6;
	filter: grayscale(1);
}

.kcd-badge.is-earned {
	border-style: solid;
	background: var(--kcd-acc-soft);
	opacity: 1;
	filter: none;
}

.kcd-badge-ico {
	font-size: 2rem;
	line-height: 1.1;
}

.kcd-badge-name {
	font-weight: 700;
}

.kcd-badge-desc {
	font-size: 0.8em;
	opacity: 0.8;
}

.kcd-badge-bar {
	display: block;
	width: 100%;
	height: 0.3rem;
	margin-top: 0.35rem;
	border-radius: 999px;
	background: var(--kcd-acc-line);
	overflow: hidden;
}

.kcd-badge-bar > span {
	display: block;
	height: 100%;
	background: currentColor;
}

/* Favorites */
.kcd-favs {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kcd-favs li {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	justify-content: space-between;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--kcd-acc-line);
}

.kcd-favs a {
	text-decoration: none;
	color: inherit;
}

.kcd-favs q {
	font-style: italic;
}

.kcd-favs span {
	opacity: 0.75;
	white-space: nowrap;
}

.kcd-fav-remove {
	flex: none;
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--kcd-acc-line);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.kcd-account .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

