/*
 * AiProfile Inside: the "Is your question not here?" form.
 *
 * Scoped to .aiprofile-inside-form. No fonts and no colours of our own: the
 * form inherits the theme's font and text colour, and every line, tint and
 * the button are derived from currentColor, so a dark theme stays dark. Each
 * color-mix() line has a plain rgba() fallback right before it.
 */

.aiprofile-inside-form {
	box-sizing: border-box;
	max-width: 640px;
	margin: 2.5em 0 1em;
	padding: 1.25em 1.5em 1.5em;
	border: 1px solid rgba(127, 127, 127, 0.3);
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-radius: 14px;
}

.aiprofile-inside-form *,
.aiprofile-inside-form *::before,
.aiprofile-inside-form *::after {
	box-sizing: border-box;
}

/* Sentence case, also under a theme that capitalizes every word (1.3.2). */
section.aiprofile-inside-form,
section.aiprofile-inside-form *,
section.aiprofile-inside-form h2.aiprofile-ask-title,
section.aiprofile-inside-form button.aiprofile-ask-button {
	text-transform: none;
}

/* Smaller than the theme's own h2s: this is a footnote to the answers. */
.aiprofile-inside-form .aiprofile-ask-title {
	margin: 0 0 0.3em;
	padding: 0;
	font-family: inherit;
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.aiprofile-inside-form .aiprofile-ask-intro {
	margin: 0 0 1.1em;
	font-size: 0.95em;
	line-height: 1.5;
	opacity: 0.85;
}

.aiprofile-inside-form .aiprofile-ask-form {
	margin: 0;
}

.aiprofile-inside-form .aiprofile-ask-field {
	margin: 0 0 1em;
}

.aiprofile-inside-form .aiprofile-ask-label {
	display: block;
	margin: 0 0 0.35em;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.4;
}

.aiprofile-inside-form textarea.aiprofile-ask-input,
.aiprofile-inside-form input.aiprofile-ask-input {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0.65em 0.85em;
	font: inherit;
	font-size: 1em;
	line-height: 1.5;
	color: inherit;
	background: transparent;
	border: 1px solid rgba(127, 127, 127, 0.5);
	border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 8px;
	box-shadow: none;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aiprofile-inside-form textarea.aiprofile-ask-input {
	min-height: 7.5em;
	resize: vertical;
}

.aiprofile-inside-form textarea.aiprofile-ask-input:focus,
.aiprofile-inside-form input.aiprofile-ask-input:focus {
	border-color: currentColor;
	box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.3);
	box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
	outline: none;
}

/* The checkbox sits on the first line of its label; the label is smaller. */
.aiprofile-inside-form .aiprofile-ask-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.6em;
	margin: 0;
	font-size: 0.85em;
	font-weight: normal;
	line-height: 1.5;
	cursor: pointer;
}

.aiprofile-inside-form .aiprofile-ask-consent input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	margin: 0.2em 0 0;
	accent-color: currentColor;
}

.aiprofile-inside-form .aiprofile-ask-consent a {
	color: inherit;
	text-decoration: underline;
}

.aiprofile-inside-form .aiprofile-ask-actions {
	margin: 1.25em 0 0;
}

/*
 * Classic themes: a solid button in the text colour with the text inverted
 * (white text that blends by difference, so it is light on a dark button
 * and dark on a light one). Block themes get .wp-element-button instead and
 * none of this.
 */
.aiprofile-inside-form .aiprofile-ask-button--classic {
	display: inline-block;
	isolation: isolate;
	margin: 0;
	padding: 0.7em 1.5em;
	font: inherit;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.2;
	color: inherit;
	background: currentColor;
	border: 0;
	border-radius: 8px;
	box-shadow: none;
	text-shadow: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.aiprofile-inside-form .aiprofile-ask-button--classic span {
	color: #fff;
	mix-blend-mode: difference;
}

.aiprofile-inside-form .aiprofile-ask-button--classic:hover {
	opacity: 0.85;
}

.aiprofile-inside-form .aiprofile-ask-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Thank you and errors, in the same quiet card style. */
.aiprofile-inside-form .aiprofile-ask-message {
	margin: 0.25em 0 1em;
	padding: 0.75em 1em;
	font-size: 0.95em;
	line-height: 1.5;
	background: rgba(127, 127, 127, 0.08);
	background: color-mix(in srgb, currentColor 6%, transparent);
	border: 1px solid rgba(127, 127, 127, 0.3);
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-left-width: 4px;
	border-left-color: currentColor;
	border-radius: 8px;
}

.aiprofile-inside-form .aiprofile-ask-message--ok {
	margin-bottom: 0;
}

@media (max-width: 480px) {
	.aiprofile-inside-form {
		padding: 1em 1.1em 1.25em;
	}

	.aiprofile-inside-form .aiprofile-ask-button {
		width: 100%;
	}
}
