/**
 * Thorn Forms — shared styles for [thorn_trial_signup] and [thorn_contact_form].
 *
 * Scoped under .thorn-form with tf- prefixed classes and --tf- custom
 * properties so nothing collides with the theme. Design tokens match the Thorn
 * redesign: Space Grotesk headings, Inter body, brand blue #0C61AC. Those fonts
 * are loaded by the theme on the brand pages; system stacks cover the rest.
 */

.thorn-form {
	--tf-accent: #0c61ac;
	--tf-accent-ink: #0a5090;
	--tf-accent-wash: #e7f0f8;
	--tf-ink: #12243d;
	--tf-body: #596a78;
	--tf-muted: #7d8b97;
	--tf-line: #dce3ea;
	--tf-line-strong: #c4cfd9;
	--tf-field-bg: #f6f8fa;
	--tf-surface: #ffffff;
	--tf-good: #1f8a4c;
	--tf-good-wash: #e4f3ea;
	--tf-bad: #c0392b;
	--tf-bad-wash: #fbe7e4;
	--tf-warn: #9a6a00;
	--tf-warn-wash: #fbf0d6;
	--tf-radius: 10px;
	--tf-radius-card: 16px;
	--tf-shadow: 0 2px 4px rgba(16, 33, 43, .06), 0 16px 40px rgba(16, 33, 43, .08);
	--tf-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--tf-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--tf-sans);
	color: var(--tf-body);
	font-size: 16px;
	line-height: 1.6;
}

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

.thorn-form [hidden] {
	display: none !important;
}

.thorn-form h2 {
	font-family: var(--tf-head);
	color: var(--tf-ink);
	font-weight: 500;
	letter-spacing: -.02em;
	margin: 0 0 .5rem;
}

/* ---- Card & panels ---- */

.thorn-form .tf-card {
	background: var(--tf-surface);
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius-card);
	padding: 2rem;
	box-shadow: var(--tf-shadow);
}

.thorn-form .tf-panel {
	animation: tf-rise .4s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes tf-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.thorn-form .tf-panel,
	.thorn-form .tf-check svg path { animation: none; }
}

/* ---- Step rail (trial) ---- */

.thorn-form .tf-steps {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	font-family: var(--tf-head);
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.thorn-form .tf-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--tf-muted);
}

.thorn-form .tf-dot {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	flex: none;
	display: grid;
	place-items: center;
	font-size: 12px;
	font-weight: 600;
	background: var(--tf-field-bg);
	color: var(--tf-muted);
	border: 1px solid var(--tf-line-strong);
	transition: background .3s, color .3s, border-color .3s;
}

.thorn-form .tf-steps li.tf-active { color: var(--tf-accent-ink); }
.thorn-form .tf-steps li.tf-active .tf-dot { background: var(--tf-accent); color: #fff; border-color: var(--tf-accent); }
.thorn-form .tf-steps li.tf-done .tf-dot { background: var(--tf-good-wash); color: var(--tf-good); border-color: var(--tf-good); }
.thorn-form .tf-sep { flex: 1; min-width: 16px; height: 1px; background: var(--tf-line-strong); }

/* ---- Fields ---- */

.thorn-form .tf-label {
	display: block;
	font-size: .82rem;
	font-weight: 600;
	color: var(--tf-ink);
	margin: 1.1rem 0 .35rem;
}

.thorn-form .tf-row .tf-label,
.thorn-form .tf-panel > .tf-label:first-of-type { margin-top: 0; }

.thorn-form .tf-req { color: var(--tf-accent); }
.thorn-form .tf-optional { color: var(--tf-muted); font-weight: 400; }

.thorn-form .tf-input {
	width: 100%;
	padding: .72rem .85rem;
	border-radius: var(--tf-radius);
	border: 1px solid var(--tf-line-strong);
	background: var(--tf-field-bg);
	color: var(--tf-ink);
	font-family: var(--tf-sans);
	font-size: 1rem;
	line-height: 1.4;
	transition: border-color .18s, box-shadow .18s, background .18s;
}

.thorn-form .tf-input:focus {
	outline: none;
	border-color: var(--tf-accent);
	background: var(--tf-surface);
	box-shadow: 0 0 0 3px var(--tf-accent-wash);
}

.thorn-form .tf-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23596a78' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .9rem center;
	background-size: 12px;
	padding-right: 2.4rem;
}

.thorn-form .tf-textarea { resize: vertical; min-height: 7rem; }

.thorn-form .tf-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .85rem;
	margin-top: 1.1rem;
}

/* The first row sits flush at the top of the form; only stacked rows get the
   vertical rhythm above (matches the label spacing elsewhere). */
.thorn-form .tf-row:first-child { margin-top: 0; }

@media (max-width: 480px) {
	.thorn-form .tf-row { grid-template-columns: 1fr; }
}

/* ---- Buttons ---- */

.thorn-form .tf-btn {
	display: block;
	width: 100%;
	margin-top: 1.5rem;
	padding: .85rem 1rem;
	background: var(--tf-accent);
	color: #fff;
	border: 0;
	border-radius: var(--tf-radius);
	font-family: var(--tf-head);
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: .01em;
	cursor: pointer;
	transition: filter .15s, transform .05s;
}

.thorn-form .tf-btn:hover { filter: brightness(1.07); }
.thorn-form .tf-btn:active { transform: translateY(1px); }
.thorn-form .tf-btn:disabled { opacity: .55; cursor: progress; filter: none; }

.thorn-form .tf-btn-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--tf-accent-ink);
	font-family: var(--tf-sans);
	font-size: .9rem;
	cursor: pointer;
	border-bottom: 1px solid var(--tf-line-strong);
}

.thorn-form .tf-btn-link:hover { border-bottom-color: var(--tf-accent); }

.thorn-form .tf-helper { font-size: .84rem; color: var(--tf-muted); margin: .4rem 0 0; }

.thorn-form .tf-fineprint {
	font-size: .78rem;
	line-height: 1.5;
	color: var(--tf-muted);
	margin: .5rem 0 0;
}

.thorn-form .tf-fineprint a { color: var(--tf-accent-ink); text-decoration: underline; }
.thorn-form .tf-eula-notice { margin-top: 1.1rem; }

/* ---- EULA checkbox ---- */

.thorn-form .tf-check-label {
	display: flex;
	align-items: flex-start;
	gap: .6rem;
	margin-top: 1.1rem;
	font-size: .85rem;
	line-height: 1.5;
	color: var(--tf-body);
	cursor: pointer;
}

/* Stacked agreements (EULA + privacy) sit closer together than a new field. */
.thorn-form .tf-check-label + .tf-check-label { margin-top: .55rem; }

.thorn-form .tf-eula-input,
.thorn-form .tf-privacy-input {
	width: 1.05rem;
	height: 1.05rem;
	margin: .15rem 0 0;
	flex: none;
	accent-color: var(--tf-accent);
	cursor: pointer;
}

.thorn-form .tf-check-label a { color: var(--tf-accent-ink); text-decoration: underline; }

/* ---- Trial option cards (second option) ---- */

.thorn-form .tf-options {
	border: 0;
	margin: 1.1rem 0 0;
	padding: 0;
	min-width: 0;
}

.thorn-form .tf-options-legend {
	padding: 0;
	font-size: .82rem;
	font-weight: 600;
	color: var(--tf-ink);
	margin: 0 0 .5rem;
}

.thorn-form .tf-option-list {
	display: grid;
	gap: .6rem;
}

.thorn-form .tf-option {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	padding: .85rem 1rem;
	border: 1px solid var(--tf-line-strong);
	border-radius: var(--tf-radius);
	background: var(--tf-surface);
	cursor: pointer;
	transition: border-color .18s, background .18s, box-shadow .18s;
}

.thorn-form .tf-option:hover { border-color: var(--tf-accent); }

.thorn-form .tf-option-input {
	width: 1.1rem;
	height: 1.1rem;
	margin: .15rem 0 0;
	flex: none;
	accent-color: var(--tf-accent);
	cursor: pointer;
}

.thorn-form .tf-option:has(.tf-option-input:checked) {
	border-color: var(--tf-accent);
	background: var(--tf-accent-wash);
	box-shadow: inset 0 0 0 1px var(--tf-accent);
}

.thorn-form .tf-option-body { display: block; }

.thorn-form .tf-option-title {
	display: block;
	font-weight: 600;
	color: var(--tf-ink);
	font-size: .95rem;
	line-height: 1.4;
}

.thorn-form .tf-option-desc {
	display: block;
	margin-top: .2rem;
	font-size: .82rem;
	line-height: 1.5;
	color: var(--tf-body);
}

/* ---- Verify step ---- */

.thorn-form .tf-verify-head { margin-bottom: 1.25rem; }

.thorn-form .tf-step-label {
	font-family: var(--tf-head);
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--tf-muted);
	margin: 0 0 6px;
}

.thorn-form .tf-verify-head h2 { font-size: 1.3rem; }
.thorn-form .tf-verify-head p { margin: 0; color: var(--tf-body); font-size: .95rem; }
.thorn-form .tf-verify-email { color: var(--tf-ink); font-weight: 600; word-break: break-all; }

.thorn-form .tf-code-boxes {
	display: flex;
	gap: .55rem;
	justify-content: space-between;
	margin: .25rem 0 .4rem;
}

.thorn-form .tf-code-input {
	width: 100%;
	aspect-ratio: 3 / 4;
	min-width: 0;
	text-align: center;
	font-family: var(--tf-head);
	font-size: 1.5rem;
	font-weight: 500;
	border: 1px solid var(--tf-line-strong);
	border-radius: var(--tf-radius);
	background: var(--tf-field-bg);
	color: var(--tf-ink);
	padding: 0;
	transition: border-color .18s, box-shadow .18s, background .18s;
}

.thorn-form .tf-code-input:focus {
	outline: none;
	border-color: var(--tf-accent);
	background: var(--tf-surface);
	box-shadow: 0 0 0 3px var(--tf-accent-wash);
}

.thorn-form .tf-code-input.tf-filled { border-color: var(--tf-accent); }

.thorn-form .tf-expiry {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: .9rem;
	font-size: .82rem;
	color: var(--tf-muted);
}

.thorn-form .tf-clock { font-family: var(--tf-head); font-weight: 500; color: var(--tf-body); }
.thorn-form .tf-clock.tf-low { color: var(--tf-bad); }

/* ---- Alerts ---- */

.thorn-form .tf-alert {
	margin-top: 1.1rem;
	padding: .85rem 1rem;
	border-radius: var(--tf-radius);
	border: 1px solid var(--tf-line);
	border-left: 3px solid var(--tf-accent);
	background: var(--tf-field-bg);
	font-size: .9rem;
}

.thorn-form .tf-alert-ok   { border-left-color: var(--tf-good); background: var(--tf-good-wash); }
.thorn-form .tf-alert-err  { border-left-color: var(--tf-bad);  background: var(--tf-bad-wash); }
.thorn-form .tf-alert-warn { border-left-color: var(--tf-warn); background: var(--tf-warn-wash); }
.thorn-form .tf-alert h3 { margin: 0 0 .25rem; font-size: .92rem; font-weight: 600; color: var(--tf-ink); font-family: var(--tf-sans); }
.thorn-form .tf-alert p  { margin: .2rem 0 0; color: var(--tf-body); }

/* ---- Done / thank-you ---- */

.thorn-form .tf-done,
.thorn-form .tf-contact-done { text-align: center; padding: .5rem 0 .25rem; }

.thorn-form .tf-check {
	width: 62px;
	height: 62px;
	margin: 0 auto 1.1rem;
	border-radius: 50%;
	background: var(--tf-good-wash);
	display: grid;
	place-items: center;
}

.thorn-form .tf-check svg { width: 30px; height: 30px; }

.thorn-form .tf-check svg path {
	stroke: var(--tf-good);
	stroke-width: 3;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 32;
	stroke-dashoffset: 32;
	animation: tf-draw .5s .15s ease-out forwards;
}

@keyframes tf-draw { to { stroke-dashoffset: 0; } }

.thorn-form .tf-done p,
.thorn-form .tf-contact-done p { color: var(--tf-body); margin: 0 0 .5rem; }

.thorn-form .tf-ref {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	margin-top: .75rem;
	font-family: var(--tf-head);
	font-size: .82rem;
	color: var(--tf-muted);
	background: var(--tf-field-bg);
	border: 1px solid var(--tf-line);
	padding: .4rem .75rem;
	border-radius: var(--tf-radius);
}

.thorn-form .tf-ref b { color: var(--tf-ink); font-weight: 600; }
.thorn-form .tf-done-helper { margin-top: 1.25rem; }
