/**
 * Custom Forms — front-end styling.
 *
 * Scoped entirely under .awpc-form-wrap and self-contained (its own colour
 * tokens, explicit input/button states) so it matches the AuthorWings brand
 * (cream / navy / sage) and resists the host theme's form/button styling.
 */

.awpc-form-wrap {
	--awpcf-navy: #1c2439;
	--awpcf-sage: #5c7a6b;
	--awpcf-sage-dark: #4b6659;
	--awpcf-muted: #5d6675;
	--awpcf-cream: #f6f1e8;
	--awpcf-border: #e2d9c8;
	--awpcf-field-border: #cfd4da;
	--awpcf-error: #b3261e;
	--awpcf-success: #2f7d4f;

	max-width: 640px;
	margin: 0 auto;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	color: var(--awpcf-navy);
	box-sizing: border-box;
}

.awpc-form-wrap *,
.awpc-form-wrap *::before,
.awpc-form-wrap *::after {
	box-sizing: border-box;
}

.awpc-form {
	background: #fff;
	border: 1px solid var(--awpcf-border);
	border-radius: 14px;
	padding: 26px 26px 22px;
}

.awpc-form-head {
	margin: 0 0 18px;
}

.awpc-form-title {
	margin: 0 0 6px;
	font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
	font-size: 1.5rem;
	line-height: 1.2;
	font-weight: 600;
	color: var(--awpcf-navy);
}

.awpc-form-desc {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--awpcf-muted);
}

/* Field grid: full-width by default, half fields share a row on wider screens. */
.awpc-form-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.awpc-form-field {
	display: flex;
	flex-direction: column;
	flex: 1 1 100%;
	min-width: 0;
}

.awpc-form-field--half {
	flex: 1 1 calc(50% - 8px);
}

@media (max-width: 520px) {
	.awpc-form-field--half {
		flex: 1 1 100%;
	}
}

.awpc-form-label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--awpcf-navy);
}

.awpc-req {
	color: var(--awpcf-sage-dark);
	font-weight: 700;
}

/* Inputs — explicit styles so the theme can't bleed in. */
.awpc-form-wrap input[type="text"],
.awpc-form-wrap input[type="email"],
.awpc-form-wrap input[type="tel"],
.awpc-form-wrap input[type="url"],
.awpc-form-wrap input[type="number"],
.awpc-form-wrap input[type="date"],
.awpc-form-wrap input[type="time"],
.awpc-form-wrap select,
.awpc-form-wrap textarea {
	width: 100%;
	margin: 0;
	padding: 11px 13px;
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--awpcf-navy);
	background: #fff;
	border: 1px solid var(--awpcf-field-border);
	border-radius: 9px;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.awpc-form-wrap textarea {
	resize: vertical;
	min-height: 96px;
}

.awpc-form-wrap select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235d6675' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 34px;
	cursor: pointer;
}

.awpc-form-wrap input:focus,
.awpc-form-wrap select:focus,
.awpc-form-wrap textarea:focus {
	outline: none;
	border-color: var(--awpcf-sage);
	box-shadow: 0 0 0 3px rgba(92, 122, 107, 0.18);
}

.awpc-form-wrap input::placeholder,
.awpc-form-wrap textarea::placeholder {
	color: #9aa1ab;
	opacity: 1;
}

/* Country-flag phone widget (intl-tel-input) — make it fill the field. */
.awpc-form-wrap .iti {
	display: block;
	width: 100%;
}

.awpc-form-wrap .iti__flag {
	/* The library serves the flag sprite; keep it crisp on retina. */
	box-shadow: none;
}

/* Radio / checkbox groups. */
.awpc-form-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.awpc-form-choice,
.awpc-form-consent {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 0;
	font-size: 0.93rem;
	line-height: 1.4;
	color: var(--awpcf-navy);
	cursor: pointer;
}

.awpc-form-consent {
	margin-top: 2px;
}

.awpc-form-choice input,
.awpc-form-consent input {
	width: 17px;
	height: 17px;
	margin: 1px 0 0;
	flex: 0 0 auto;
	accent-color: var(--awpcf-sage);
	cursor: pointer;
}

/* Honeypot — hidden from real people, still submitted. */
.awpc-form-wrap .awpc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Actions. */
.awpc-form-actions {
	margin: 22px 0 0;
}

.awpc-form-wrap .awpc-form-submit {
	display: inline-block;
	width: 100%;
	margin: 0;
	padding: 13px 22px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: #fff;
	background: var(--awpcf-sage);
	border: 1px solid var(--awpcf-sage);
	border-radius: 10px;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.awpc-form-wrap .awpc-form-submit:hover,
.awpc-form-wrap .awpc-form-submit:focus {
	background: var(--awpcf-sage-dark);
	border-color: var(--awpcf-sage-dark);
	color: #fff;
}

.awpc-form-wrap .awpc-form-submit:focus-visible {
	outline: 3px solid rgba(92, 122, 107, 0.35);
	outline-offset: 2px;
}

.awpc-form-wrap .awpc-form-submit.is-loading {
	opacity: 0.7;
	cursor: progress;
}

.awpc-form-wrap .awpc-form-submit[disabled] {
	cursor: not-allowed;
}

/* Status message. */
.awpc-form-msg {
	margin: 12px 0 0;
	font-size: 0.9rem;
	line-height: 1.45;
	min-height: 1em;
}

.awpc-form-msg.is-error {
	color: var(--awpcf-error);
}

.awpc-form-msg.is-success {
	color: var(--awpcf-success);
}

.awpc-form-msg.is-info {
	color: var(--awpcf-muted);
}

/* Success panel (replaces the form after submit). */
.awpc-form-done {
	background: #eef5f0;
	border: 1px solid #c3d8c9;
	border-radius: 14px;
	padding: 26px;
	text-align: center;
}

.awpc-form-done-title {
	margin: 0 0 8px;
	font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--awpcf-sage-dark);
}

.awpc-form-done-body {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--awpcf-navy);
}

/* Admin "form not found" notice. */
.awpc-form-error {
	margin: 0;
	padding: 12px 16px;
	font-size: 0.9rem;
	color: #8a6d3b;
	background: #fcf8e3;
	border: 1px solid #faebcc;
	border-radius: 8px;
}
