/* The demo form. It reads the theme's brand variables when they exist, and falls back to the
   connectable navy and gold so it looks right with any theme. */

.cn-demo-form {
	--cn-demo-navy: var(--cn-navy, #13283d);
	--cn-demo-gold: var(--cn-gold, #c9a063);
	--cn-demo-gold-soft: var(--cn-gold-soft, #f5ecdb);
	--cn-demo-text: var(--cn-ink, #1f2a37);
	--cn-demo-muted: var(--cn-muted, #5f6b7a);
	--cn-demo-border: var(--cn-line, #e4ddd0);
	--cn-demo-danger: #c2414b;

	display: grid;
	gap: 22px;
	font-size: 15px;
	color: var(--cn-demo-text);
}

.cn-demo-form__group {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.cn-demo-form__legend {
	margin-bottom: 4px;
	padding: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #9a7738;
}

.cn-demo-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.cn-demo-form__row--thirds {
	grid-template-columns: 1fr 1fr 1fr;
}

.cn-demo-form__field {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.cn-demo-form__field label {
	font-weight: 600;
	font-size: 14px;
}

.cn-demo-form__required {
	color: #9a7738;
}

.cn-demo-form input:not([type="hidden"]),
.cn-demo-form select,
.cn-demo-form textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid var(--cn-demo-border);
	border-radius: 10px;
	background: #fff;
	font: inherit;
	color: inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.cn-demo-form textarea {
	min-height: 110px;
	resize: vertical;
}

.cn-demo-form input:focus,
.cn-demo-form select:focus,
.cn-demo-form textarea:focus {
	outline: none;
	border-color: var(--cn-demo-gold);
	box-shadow: 0 0 0 4px rgba(201, 160, 99, .22);
}

.cn-demo-form [aria-invalid="true"] {
	border-color: var(--cn-demo-danger);
}

.cn-demo-form__error {
	margin: 0;
	font-size: 13px;
	color: var(--cn-demo-danger);
}

.cn-demo-form__alert {
	padding: 12px 16px;
	border-radius: 10px;
	background: #fdeeee;
	color: #8f2730;
	font-weight: 600;
}

/* Hidden from people but not from bots, which fill every field. */
.cn-demo-form__trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cn-demo-form__submit {
	display: grid;
	gap: 10px;
}

.cn-demo-form__button {
	justify-self: start;
	min-height: 52px;
	padding: 0 30px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #e7cf9f 0%, #c9a063 100%);
	color: var(--cn-demo-navy);
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	box-shadow: 0 10px 24px -12px rgba(169, 130, 63, .8);
	transition: transform .15s ease, box-shadow .15s ease;
}

.cn-demo-form__button:hover,
.cn-demo-form__button:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px -12px rgba(169, 130, 63, .9);
}

.cn-demo-form__button.is-sending {
	opacity: .7;
	cursor: progress;
}

.cn-demo-form__note {
	margin: 0;
	font-size: 13px;
	color: var(--cn-demo-muted);
}

.cn-demo-form--sent {
	justify-items: start;
	gap: 10px;
	outline: none;
}

.cn-demo-form--sent p {
	margin: 0;
}

.cn-demo-form__sent-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--cn-demo-gold-soft);
	color: #8a6a30;
}

.cn-demo-form__sent-title {
	margin: 6px 0 0;
	font-size: 24px;
	color: var(--cn-demo-navy);
}

@media (max-width: 640px) {
	.cn-demo-form__row,
	.cn-demo-form__row--thirds {
		grid-template-columns: 1fr;
	}

	.cn-demo-form__button {
		justify-self: stretch;
	}
}
