/**
 * Software Is Good - Course Registration, public form.
 *
 * Everything is scoped under .sigcr. Themes like Flatsome style every input and
 * button on the page, so the first block below takes those declarations back
 * for our own controls instead of fighting them field by field.
 */

.sigcr {
	--sigcr-accent: #ea3959;
	--sigcr-accent-ink: #b82744;
	--sigcr-ink: #1d2327;
	--sigcr-muted: #646970;
	--sigcr-line: #e2e4e7;
	--sigcr-bg: #f5f6f7;
	--sigcr-surface: #fff;
	--sigcr-bad: #b32d3f;
	--sigcr-radius: 12px;
	--sigcr-radius-sm: 8px;

	max-width: 860px;
	margin: 0 auto;
	color: var(--sigcr-ink);
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
}

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

/* --- take back the controls from the theme --- */
.sigcr .sigcr-input,
.sigcr .sigcr-btn {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.4;
	min-height: 0;
	max-width: none;
	border-radius: var(--sigcr-radius-sm);
}

.sigcr .sigcr-input:not(:focus),
.sigcr .sigcr-btn:not(:focus) {
	box-shadow: none;
}

/* --- the panel everything sits in --- */
.sigcr-panel {
	padding: 20px;
	border: 1px solid var(--sigcr-line);
	border-radius: 14px;
	background: var(--sigcr-bg);
}

.sigcr-panel__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 4px 4px 18px;
}

.sigcr-panel__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: var(--sigcr-radius-sm);
	background: var(--sigcr-accent);
	color: #fff;
}

.sigcr-panel__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.sigcr-panel__intro {
	margin: 2px 0 0;
	color: var(--sigcr-muted);
	font-size: 14px;
}

/* The last card inside the panel should not add a gap above its edge. */
.sigcr-panel__body > *:last-child {
	margin-bottom: 0;
}

/* --- notices --- */
.sigcr-notice {
	margin: 0 0 20px;
	padding: 16px 18px;
	border: 1px solid var(--sigcr-line);
	border-left: 3px solid var(--sigcr-muted);
	border-radius: var(--sigcr-radius-sm);
	background: var(--sigcr-surface);
}

.sigcr-notice p {
	margin: 0 0 8px;
}

.sigcr-notice p:last-child {
	margin-bottom: 0;
}

.sigcr-notice--error {
	border-left-color: var(--sigcr-bad);
	background: #fdf3f4;
}

.sigcr-notice--ok {
	border-left-color: var(--sigcr-accent);
}

.sigcr-notice__title {
	margin: 0 0 8px;
	font-size: 18px;
}

/* --- sections --- */
.sigcr-section {
	margin: 0 0 20px;
	padding: 22px 24px;
	border: 1px solid var(--sigcr-line);
	border-radius: var(--sigcr-radius);
	background: var(--sigcr-surface);
	box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.04 );
}

.sigcr-section.is-invalid {
	border-color: #f0c2c8;
}

/* A legend sits on the fieldset's border by default, which cuts the card in
   half. Floating it turns it into an ordinary heading inside the card; what
   follows has to clear the float. */
.sigcr-section__title {
	float: left;
	width: 100%;
	margin: 0 0 4px;
	padding: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--sigcr-ink);
}

.sigcr-section__intro {
	clear: both;
	margin: 0 0 18px;
	color: var(--sigcr-muted);
	font-size: 14px;
}

.sigcr-section__title + .sigcr-choices,
.sigcr-section__title + .sigcr-grid,
.sigcr-section__title + .sigcr-privacy,
.sigcr-section__title + .sigcr-signature {
	clear: both;
}

/* --- fields --- */
.sigcr-grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 16px 20px;
}

.sigcr-field--wide {
	grid-column: 1 / -1;
}

.sigcr-label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sigcr-ink);
}

.sigcr-required {
	color: var(--sigcr-accent);
}

.sigcr .sigcr-input {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--sigcr-line);
	background: var(--sigcr-surface);
	color: var(--sigcr-ink);
	transition: border-color 0.12s ease;
}

.sigcr .sigcr-input:focus {
	border-color: var(--sigcr-accent);
	outline: 2px solid rgba( 234, 57, 89, 0.18 );
	outline-offset: 1px;
}

.sigcr .is-invalid .sigcr-input {
	border-color: #e19aa4;
}

.sigcr-error {
	margin: 6px 0 0;
	color: var(--sigcr-bad);
	font-size: 13px;
}

/* --- choices --- */
.sigcr-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.sigcr-choice {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 10px 16px;
	border: 1px solid var(--sigcr-line);
	border-radius: 999px;
	background: var(--sigcr-surface);
	cursor: pointer;
	font-size: 14px;
}

.sigcr-choice:hover {
	border-color: #c9ccd0;
}

.sigcr-choice input {
	margin: 0;
	accent-color: var(--sigcr-accent);
}

.sigcr-choice:focus-within {
	border-color: var(--sigcr-accent);
	outline: 2px solid rgba( 234, 57, 89, 0.18 );
}

/* --- fee block --- */
.sigcr-note {
	margin: 0 0 16px;
	padding: 14px 16px;
	border-radius: var(--sigcr-radius-sm);
	background: var(--sigcr-bg);
	font-size: 14px;
}

.sigcr-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14px;
}

.sigcr-table caption {
	margin-bottom: 8px;
	color: var(--sigcr-muted);
	font-size: 13px;
	font-weight: 600;
	text-align: left;
}

.sigcr-table th,
.sigcr-table td {
	padding: 8px 12px 8px 0;
	border-bottom: 1px solid var(--sigcr-line);
	text-align: left;
	vertical-align: top;
}

.sigcr-table th {
	color: var(--sigcr-muted);
	font-weight: 600;
}

.sigcr-table tr:last-child td {
	border-bottom: 0;
}

/* --- privacy and consent --- */
.sigcr-privacy {
	max-height: 220px;
	overflow-y: auto;
	margin: 0 0 18px;
	padding: 16px 18px;
	border: 1px solid var(--sigcr-line);
	border-radius: var(--sigcr-radius-sm);
	background: var(--sigcr-bg);
	font-size: 13.5px;
}

.sigcr-privacy__title {
	margin: 14px 0 4px;
	font-size: 14px;
	font-weight: 600;
}

.sigcr-privacy__title:first-child {
	margin-top: 0;
}

.sigcr-privacy__text {
	margin: 0;
	color: var(--sigcr-muted);
}

.sigcr-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
}

.sigcr-consent input {
	margin: 3px 0 0;
	accent-color: var(--sigcr-accent);
}

/* --- signature --- */
.sigcr-signature {
	border: 1px solid var(--sigcr-line);
	border-radius: var(--sigcr-radius-sm);
	background: var(--sigcr-surface);
	overflow: hidden;

	/* A signature is a drag; without this it selects the text around the box. */
	-webkit-user-select: none;
	user-select: none;
}

.sigcr-signature__canvas {
	display: block;
	width: 100%;
	height: 180px;
	touch-action: none;
	cursor: crosshair;
	background:
		linear-gradient( to right, transparent 0 24px, var(--sigcr-line) 24px calc( 100% - 24px ), transparent calc( 100% - 24px ) )
		bottom 44px left 0 / 100% 1px no-repeat;
}

.sigcr-signature__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-top: 1px solid var(--sigcr-line);
	background: var(--sigcr-bg);
}

.sigcr-signature__hint {
	color: var(--sigcr-muted);
	font-size: 13px;
}

/* --- buttons --- */
.sigcr .sigcr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

.sigcr .sigcr-btn--primary {
	background: var(--sigcr-accent);
	color: #fff;
}

.sigcr .sigcr-btn--primary:hover,
.sigcr .sigcr-btn--primary:focus {
	background: var(--sigcr-accent-ink);
	color: #fff;
}

.sigcr .sigcr-btn--ghost {
	border-color: var(--sigcr-line);
	background: var(--sigcr-surface);
	color: var(--sigcr-ink);
	padding: 7px 14px;
	font-size: 13px;
}

.sigcr .sigcr-btn--ghost:hover,
.sigcr .sigcr-btn--ghost:focus {
	border-color: #c9ccd0;
	background: var(--sigcr-bg);
	color: var(--sigcr-ink);
}

/* --- footer --- */
.sigcr-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 18px 24px;
	border: 1px solid var(--sigcr-line);
	border-radius: var(--sigcr-radius);
	background: var(--sigcr-surface);
}

.sigcr-actions__note {
	margin: 0;
	color: var(--sigcr-muted);
	font-size: 13px;
}

/* The honeypot: present for a robot, gone for everybody else. */
.sigcr-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media ( max-width: 640px ) {
	.sigcr-grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.sigcr-panel {
		padding: 12px;
		border-radius: 12px;
	}

	.sigcr-panel__head {
		padding: 4px 2px 14px;
	}

	.sigcr-panel__title {
		font-size: 18px;
	}

	.sigcr-section {
		padding: 18px 16px;
	}

	.sigcr-actions {
		padding: 16px;
	}

	.sigcr .sigcr-btn--primary {
		width: 100%;
	}
}

/* Help text under a field: quieter than the label, never mistaken for an error. */
.sigcr-help {
	margin: 6px 0 0;
	color: var(--sigcr-muted);
	font-size: 13px;
}
