/* Rand Contact Form – front end. All classes start with "rcf" to avoid theme conflicts. */

.rcf {
	--rcf-accent: #e11d48;
	--rcf-btn-text: #ffffff;
	--rcf-bg: #ffffff;
	--rcf-text: #0f172a;
	--rcf-field-bg: #ffffff;
	--rcf-border: #cbd5e1;
	--rcf-radius: 12px;
	--rcf-pad: 32px;
	--rcf-max: 720px;
	--rcf-font: 16px;
	--rcf-muted: color-mix(in srgb, var(--rcf-text) 58%, transparent);
	--rcf-error: #dc2626;
	--rcf-ok: #16a34a;
	--rcf-ring: color-mix(in srgb, var(--rcf-accent) 20%, transparent);
	box-sizing: border-box;
	position: relative;
	width: 100%;
	max-width: var(--rcf-max);
	margin: 0 auto;
	padding: var(--rcf-pad);
	background: var(--rcf-bg);
	color: var(--rcf-text);
	border-radius: calc(var(--rcf-radius) + 6px);
	font-size: var(--rcf-font);
	line-height: 1.5;
	text-align: left;
}
.rcf *, .rcf *::before, .rcf *::after { box-sizing: border-box; }
.rcf.rcf--shadow { box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 24px 48px -24px rgba(15, 23, 42, .25); border: 1px solid color-mix(in srgb, var(--rcf-text) 7%, transparent); }
.rcf .rcf-title { margin: 0 0 20px; font-size: 1.5em; line-height: 1.25; color: var(--rcf-text); }
.rcf-form { margin: 0; }

/* Grid */
.rcf .rcf-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--rcf-gap, 18px) 16px; }
.rcf .rcf-w-full { grid-column: span 6; }
.rcf .rcf-w-half { grid-column: span 3; }
.rcf .rcf-w-third { grid-column: span 2; }
@media (max-width: 600px) {
	.rcf { padding: min(var(--rcf-pad), 20px); }
	.rcf .rcf-w-half, .rcf .rcf-w-third { grid-column: span 6; }
}

/* Fields */
.rcf .rcf-field { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; }
.rcf .rcf-control { position: relative; }
.rcf .rcf-control input,
.rcf .rcf-control textarea,
.rcf .rcf-control select {
	display: block; width: 100%; margin: 0; min-height: 56px;
	padding: 24px 16px 8px; font: inherit; font-size: 1em; line-height: 1.4;
	color: var(--rcf-text); background: var(--rcf-field-bg);
	border: 1.5px solid var(--rcf-border); border-radius: var(--rcf-radius);
	box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.rcf .rcf-control textarea { min-height: 120px; padding-top: 28px; resize: vertical; }
.rcf .rcf-control select { padding-right: 44px; cursor: pointer; }
.rcf .rcf-control input:hover, .rcf .rcf-control textarea:hover, .rcf .rcf-control select:hover { border-color: color-mix(in srgb, var(--rcf-border) 55%, var(--rcf-text)); }
.rcf .rcf-control input:focus, .rcf .rcf-control textarea:focus, .rcf .rcf-control select:focus { border-color: var(--rcf-accent); box-shadow: 0 0 0 4px var(--rcf-ring); }
.rcf .rcf-control input::placeholder, .rcf .rcf-control textarea::placeholder { color: transparent; }
.rcf .rcf-control input:focus::placeholder, .rcf .rcf-control textarea:focus::placeholder { color: var(--rcf-muted); }

/* Floating labels */
.rcf .rcf-control label {
	position: absolute; left: 17px; top: 17px; max-width: calc(100% - 34px); margin: 0;
	color: var(--rcf-muted); font-size: 1em; line-height: 1.4; font-weight: 400;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
	transform-origin: 0 0; transition: transform .2s cubic-bezier(.2, .8, .2, 1), color .2s ease;
}
.rcf .rcf-control input:focus + label,
.rcf .rcf-control input:not(:placeholder-shown) + label,
.rcf .rcf-control textarea:focus + label,
.rcf .rcf-control textarea:not(:placeholder-shown) + label,
.rcf .has-value-always .rcf-control label { transform: translateY(-10px) scale(.76); font-weight: 600; }
.rcf .rcf-control input:focus + label, .rcf .rcf-control textarea:focus + label, .rcf .rcf-control select:focus + label { color: var(--rcf-accent); }
.rcf .rcf-req { margin-left: 2px; color: var(--rcf-accent); }
.rcf .rcf-chevron { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--rcf-muted); stroke-width: 2; pointer-events: none; transition: transform .2s; }
.rcf .rcf-control select:focus ~ .rcf-chevron { stroke: var(--rcf-accent); transform: rotate(180deg); }

/* Labels above the field (floating labels off) */
.rcf:not(.rcf--floating) .rcf-control { display: flex; flex-direction: column-reverse; }
.rcf:not(.rcf--floating) .rcf-control label { position: static; transform: none !important; max-width: none; margin: 0 0 7px; color: var(--rcf-text); font-weight: 600; font-size: .92em; }
.rcf:not(.rcf--floating) .rcf-control input, .rcf:not(.rcf--floating) .rcf-control select { min-height: 50px; padding: 12px 16px; }
.rcf:not(.rcf--floating) .rcf-control textarea { padding: 14px 16px; }
.rcf:not(.rcf--floating) .rcf-control input::placeholder, .rcf:not(.rcf--floating) .rcf-control textarea::placeholder { color: var(--rcf-muted); }
.rcf:not(.rcf--floating) .rcf-chevron { top: auto; bottom: 16px; margin: 0; }

/* Field style: filled */
.rcf.rcf--filled .rcf-control input, .rcf.rcf--filled .rcf-control textarea, .rcf.rcf--filled .rcf-control select {
	background: color-mix(in srgb, var(--rcf-text) 5%, var(--rcf-field-bg)); border-color: transparent;
	border-bottom: 2px solid var(--rcf-border); border-radius: var(--rcf-radius) var(--rcf-radius) 4px 4px;
}
.rcf.rcf--filled .rcf-control input:focus, .rcf.rcf--filled .rcf-control textarea:focus, .rcf.rcf--filled .rcf-control select:focus { background: color-mix(in srgb, var(--rcf-accent) 6%, var(--rcf-field-bg)); border-bottom-color: var(--rcf-accent); box-shadow: none; }

/* Field style: underline */
.rcf.rcf--underline .rcf-control input, .rcf.rcf--underline .rcf-control textarea, .rcf.rcf--underline .rcf-control select {
	background: transparent; border-width: 0 0 1.5px; border-radius: 0; padding-left: 2px; padding-right: 2px;
}
.rcf.rcf--underline .rcf-control select { padding-right: 32px; }
.rcf.rcf--underline .rcf-control label { left: 2px; }
.rcf.rcf--underline .rcf-chevron { right: 4px; }
.rcf.rcf--underline .rcf-control input:focus, .rcf.rcf--underline .rcf-control textarea:focus, .rcf.rcf--underline .rcf-control select:focus { box-shadow: 0 1.5px 0 0 var(--rcf-accent); }

/* Help, counter, errors */
.rcf .rcf-help { margin: 6px 2px 0; font-size: .82em; color: var(--rcf-muted); }
.rcf .rcf-count { position: absolute; right: 12px; bottom: 8px; font-size: .72em; color: var(--rcf-muted); pointer-events: none; }
.rcf .rcf-error { margin: 0; max-height: 0; overflow: hidden; font-size: .84em; font-weight: 500; color: var(--rcf-error); opacity: 0; transition: max-height .25s ease, opacity .25s ease, margin .25s ease; }
.rcf .is-invalid .rcf-error { max-height: 80px; margin-top: 6px; opacity: 1; }
.rcf .is-invalid .rcf-control input, .rcf .is-invalid .rcf-control textarea, .rcf .is-invalid .rcf-control select { border-color: var(--rcf-error); }
.rcf .is-invalid .rcf-control input:focus, .rcf .is-invalid .rcf-control textarea:focus, .rcf .is-invalid .rcf-control select:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--rcf-error) 18%, transparent); }
.rcf .is-invalid .rcf-control label, .rcf .is-invalid .rcf-legend { color: var(--rcf-error); }
.rcf .is-valid .rcf-control input:not(:focus), .rcf .is-valid .rcf-control textarea:not(:focus), .rcf .is-valid .rcf-control select:not(:focus) { border-color: color-mix(in srgb, var(--rcf-ok) 55%, var(--rcf-border)); }
.rcf .is-shake { animation: rcf-shake .38s ease; }
@keyframes rcf-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Choices */
.rcf .rcf-legend { display: block; margin: 0 0 10px; padding: 0; font-size: .92em; font-weight: 600; color: var(--rcf-text); }
.rcf .rcf-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.rcf .rcf-choice { position: relative; display: inline-flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; font-size: .96em; }
.rcf .rcf-choices .rcf-choice { padding: 10px 14px; border: 1.5px solid var(--rcf-border); border-radius: var(--rcf-radius); background: var(--rcf-field-bg); transition: border-color .2s, background .2s; }
.rcf .rcf-choices .rcf-choice:hover { border-color: color-mix(in srgb, var(--rcf-accent) 45%, var(--rcf-border)); }
.rcf .rcf-choices .rcf-choice:has(input:checked) { border-color: var(--rcf-accent); background: color-mix(in srgb, var(--rcf-accent) 7%, var(--rcf-field-bg)); }
.rcf .rcf-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rcf .rcf-choice__box {
	flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; display: grid; place-items: center;
	border: 1.5px solid var(--rcf-border); border-radius: 6px; background: var(--rcf-field-bg); transition: all .2s ease;
}
.rcf input[type="radio"] + .rcf-choice__box { border-radius: 50%; }
.rcf .rcf-choice__box::after { content: ""; width: 10px; height: 6px; border: solid var(--rcf-btn-text); border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.rcf input[type="radio"] + .rcf-choice__box::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--rcf-btn-text); margin: 0; transform: scale(0); }
.rcf .rcf-choice input:checked + .rcf-choice__box { background: var(--rcf-accent); border-color: var(--rcf-accent); }
.rcf .rcf-choice input:checked + .rcf-choice__box::after { transform: rotate(-45deg) scale(1); }
.rcf input[type="radio"]:checked + .rcf-choice__box::after { transform: scale(1); }
.rcf .rcf-choice input:focus-visible + .rcf-choice__box { box-shadow: 0 0 0 4px var(--rcf-ring); }
.rcf .rcf-choice__label a { color: var(--rcf-accent); }
.rcf .rcf-choice--consent { font-size: .9em; color: color-mix(in srgb, var(--rcf-text) 80%, transparent); line-height: 1.5; }
.rcf .is-invalid .rcf-choice__box { border-color: var(--rcf-error); }

/* Heading */
.rcf .rcf-heading { margin: 8px 0 2px; font-size: 1.15em; color: var(--rcf-text); }
.rcf .rcf-heading-text { margin: 0; color: var(--rcf-muted); font-size: .94em; }

/* File upload */
.rcf .rcf-drop {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; text-align: center; cursor: pointer;
	border: 1.5px dashed var(--rcf-border); border-radius: var(--rcf-radius); background: color-mix(in srgb, var(--rcf-text) 2%, var(--rcf-field-bg));
	transition: border-color .2s, background .2s;
}
.rcf .rcf-drop:hover, .rcf .rcf-drop.is-over { border-color: var(--rcf-accent); background: color-mix(in srgb, var(--rcf-accent) 6%, var(--rcf-field-bg)); }
.rcf .rcf-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.rcf .rcf-drop input:focus-visible ~ svg { outline: 3px solid var(--rcf-ring); border-radius: 50%; }
.rcf .rcf-drop svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; fill: none; stroke: var(--rcf-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; background: color-mix(in srgb, var(--rcf-accent) 12%, transparent); box-sizing: content-box; }
.rcf .rcf-drop__text { font-size: .95em; }
.rcf .rcf-drop__text strong { color: var(--rcf-accent); }
.rcf .rcf-drop__hint { font-size: .78em; color: var(--rcf-muted); }
.rcf .rcf-files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rcf .rcf-files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--rcf-text) 5%, transparent); font-size: .88em; animation: rcf-in .25s ease; }
.rcf .rcf-files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcf .rcf-files li small { color: var(--rcf-muted); }
.rcf .rcf-files button { flex: 0 0 auto; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--rcf-muted); cursor: pointer; font-size: 18px; line-height: 1; }
.rcf .rcf-files button:hover { background: color-mix(in srgb, var(--rcf-error) 12%, transparent); color: var(--rcf-error); }

/* Honeypot */
.rcf .rcf-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Captcha */
.rcf .rcf-captcha { margin-top: 18px; }
.rcf .rcf-captcha[hidden] { display: none; }
.rcf .rcf-legal { margin: 14px 0 0; font-size: .74em; color: var(--rcf-muted); }
.rcf .rcf-legal a { color: inherit; }

/* Status message */
.rcf .rcf-status { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 16px; border-radius: var(--rcf-radius); background: color-mix(in srgb, var(--rcf-error) 9%, var(--rcf-bg)); border: 1px solid color-mix(in srgb, var(--rcf-error) 30%, transparent); color: var(--rcf-error); font-size: .93em; font-weight: 500; animation: rcf-in .3s ease; }
.rcf .rcf-status[hidden] { display: none; }
.rcf .rcf-status::before { content: "!"; flex: 0 0 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--rcf-error); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; margin-top: 1px; }

/* Submit */
.rcf .rcf-actions { display: flex; margin-top: 24px; }
.rcf.rcf--align-center .rcf-actions { justify-content: center; }
.rcf.rcf--align-right .rcf-actions { justify-content: flex-end; }
.rcf .rcf-submit {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; margin: 0;
	padding: 14px 28px; border: 0; border-radius: var(--rcf-radius); cursor: pointer;
	background: var(--rcf-accent); color: var(--rcf-btn-text); font: inherit; font-size: 1em; font-weight: 600; letter-spacing: .01em;
	box-shadow: 0 10px 24px -12px var(--rcf-accent); transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.rcf.rcf--btn-full .rcf-submit { width: 100%; }
.rcf .rcf-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px var(--rcf-accent); filter: brightness(1.05); }
.rcf .rcf-submit:active { transform: translateY(0); }
.rcf .rcf-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--rcf-ring); }
.rcf .rcf-submit__icon { transition: transform .25s ease; }
.rcf .rcf-submit:hover .rcf-submit__icon { transform: translate(3px, -3px); }
.rcf .rcf-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid color-mix(in srgb, var(--rcf-btn-text) 35%, transparent); border-top-color: var(--rcf-btn-text); border-radius: 50%; animation: rcf-spin .7s linear infinite; }
.rcf .is-sending .rcf-submit { cursor: progress; transform: none; filter: saturate(.85); }
.rcf .is-sending .rcf-spinner { display: block; }
.rcf .is-sending .rcf-submit__icon { display: none; }
@keyframes rcf-spin { to { transform: rotate(360deg); } }
@keyframes rcf-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Success */
.rcf .rcf-success { padding: 24px 8px; text-align: center; animation: rcf-in .45s ease; outline: none; }
.rcf .rcf-success[hidden] { display: none; }
.rcf .rcf-success__icon svg { width: 76px; height: 76px; }
.rcf .rcf-success__icon circle { stroke: var(--rcf-accent); stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152; animation: rcf-draw .7s ease forwards; }
.rcf .rcf-success__icon path { stroke: var(--rcf-accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: rcf-draw .4s .55s ease forwards; }
@keyframes rcf-draw { to { stroke-dashoffset: 0; } }
.rcf .rcf-success__title { margin: 14px 0 6px; font-size: 1.45em; color: var(--rcf-text); }
.rcf .rcf-success__text { color: var(--rcf-muted); }
.rcf .rcf-success__text p { margin: 0 0 .6em; }
.rcf .rcf-again { margin-top: 10px; padding: 8px 16px; border: 1.5px solid var(--rcf-border); border-radius: 999px; background: transparent; color: var(--rcf-text); font: inherit; font-size: .9em; cursor: pointer; }
.rcf .rcf-again:hover { border-color: var(--rcf-accent); color: var(--rcf-accent); }

/* Editor notice */
.rcf-notice { padding: 14px 16px; border: 1px dashed #94a3b8; border-radius: 10px; background: #f8fafc; color: #475569; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
	.rcf *, .rcf *::before, .rcf *::after { animation: none !important; transition: none !important; }
	.rcf .rcf-success__icon circle, .rcf .rcf-success__icon path { stroke-dashoffset: 0; }
}
