/* ESC Forms — uses the Unicamp theme colours when available. Logical properties keep RTL correct. */
.escf {
	--escf-primary: var(--unicamp-color-primary, #0078d7);
	--escf-primary-rgb: var(--unicamp-color-primary-rgb, 0, 120, 215);
	--escf-navy: #101267;
	--escf-text: #1f2430;
	--escf-muted: #6b7280;
	--escf-border: #d6dbe3;
	--escf-bg: #fff;
	--escf-soft: #f5f8fc;
	--escf-error: #c62828;
	--escf-success: #1b8a4b;
	--escf-radius: 10px;
	font-family: inherit;
	color: var(--escf-text);
	font-size: 15px;
	line-height: 1.6;
}
.escf *, .escf *::before, .escf *::after { box-sizing: border-box; }

.escf-form {
	background: var(--escf-bg);
	border: 1px solid #e7ebf1;
	border-radius: 16px;
	padding: clamp(18px, 4vw, 36px);
	box-shadow: 0 10px 30px rgba(16, 18, 103, .06);
}

.escf-note { margin: 0 0 8px; font-size: 13px; color: var(--escf-muted); }

.escf-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: 20px;
	row-gap: 18px;
}
.escf-w-full    { grid-column: span 12; }
.escf-w-half    { grid-column: span 6; }
.escf-w-quarter { grid-column: span 3; }
@media (max-width: 900px) { .escf-w-quarter { grid-column: span 6; } }
@media (max-width: 600px) { .escf-w-half, .escf-w-quarter { grid-column: span 12; } }

/* Sections */
.escf-section { margin-top: 14px; padding-top: 18px; border-top: 1px solid #edf0f4; }
.escf-grid > .escf-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.escf-section__title {
	position: relative;
	margin: 0;
	padding-inline-start: 14px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--escf-navy);
}
.escf-section__title::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 4px;
	bottom: 4px;
	width: 4px;
	border-radius: 4px;
	background: var(--escf-primary);
}
.escf-section__desc { margin: 4px 0 0; padding-inline-start: 14px; font-size: 13px; color: var(--escf-muted); }

/* Labels + inputs */
.escf-label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--escf-text);
	line-height: 1.5;
}
.escf-req { color: var(--escf-error); margin-inline-start: 2px; }

.escf .escf-input {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	font: inherit;
	font-size: 15px;
	color: var(--escf-text);
	background: var(--escf-soft);
	border: 1px solid var(--escf-border);
	border-radius: var(--escf-radius);
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s, background-color .15s;
	-webkit-appearance: none;
	appearance: none;
}
.escf textarea.escf-input { min-height: 140px; resize: vertical; }
.escf .escf-input:hover { border-color: #b9c2cf; }
.escf .escf-input:focus {
	outline: none;
	background: #fff;
	border-color: var(--escf-primary);
	box-shadow: 0 0 0 4px rgba(var(--escf-primary-rgb), .15);
}
.escf input[type="date"].escf-input { min-height: 48px; }
.escf [dir="rtl"] input[dir="ltr"], .escf[dir="rtl"] input[dir="ltr"] { text-align: right; }

.escf-select { position: relative; }
.escf-select::after {
	content: "";
	position: absolute;
	inset-inline-end: 16px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var(--escf-muted);
	border-bottom: 2px solid var(--escf-muted);
	transform: rotate(45deg);
	pointer-events: none;
}
.escf .escf-select select.escf-input { padding-inline-end: 40px; cursor: pointer; }

.escf-other { margin-top: 10px; }

/* Radio / checkbox */
.escf-choices { margin: 0; padding: 0; border: 0; min-width: 0; }
.escf-choices > legend { float: none; width: 100%; }
.escf-choices--inline { display: flex; flex-wrap: wrap; gap: 10px; }
.escf-choices--inline > legend { flex-basis: 100%; }
.escf-choices--cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.escf-choices--cols > legend { grid-column: 1 / -1; }
@media (max-width: 600px) { .escf-choices--cols { grid-template-columns: 1fr; } }

.escf-choice {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
	padding: 10px 14px;
	font-weight: 400;
	cursor: pointer;
	border: 1px solid var(--escf-border);
	border-radius: var(--escf-radius);
	background: #fff;
	transition: border-color .15s, background-color .15s;
}
.escf-choices--inline .escf-choice { margin: 0; min-width: 110px; }
.escf-choice:hover { border-color: #b9c2cf; }
.escf-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.escf-choice__box {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin-top: 2px;
	border: 2px solid #aab3c0;
	border-radius: 6px;
	background: #fff;
	transition: all .15s;
}
.escf-choice input[type="radio"] + .escf-choice__box { border-radius: 50%; }
.escf-choice input:checked + .escf-choice__box {
	border-color: var(--escf-primary);
	background: var(--escf-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.escf-choice input[type="radio"]:checked + .escf-choice__box { background: #fff; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--escf-primary); }
.escf-choice:has(input:checked) { border-color: var(--escf-primary); background: rgba(var(--escf-primary-rgb), .05); }
.escf-choice input:focus-visible + .escf-choice__box { box-shadow: 0 0 0 4px rgba(var(--escf-primary-rgb), .25); }
.escf-choice__text { font-size: 14.5px; line-height: 1.5; }
.escf-choice--consent { background: var(--escf-soft); }

/* HTML block (terms) */
.escf-html {
	padding: 14px 18px;
	background: var(--escf-soft);
	border-radius: var(--escf-radius);
	font-size: 14px;
}
.escf-html ol { margin: 0; padding-inline-start: 20px; }
.escf-html li { margin: 4px 0; }

/* File upload — label and box stack so boxes line up even when a label wraps */
.escf-field--file { display: flex; flex-direction: column; }
.escf-field--file .escf-label { flex: 1 0 auto; }
.escf-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 132px;
	padding: 14px 10px;
	text-align: center;
	cursor: pointer;
	border: 2px dashed #c5cdd9;
	border-radius: 12px;
	background: var(--escf-soft);
	overflow: hidden;
	transition: border-color .15s, background-color .15s;
}
.escf-drop:hover, .escf-drop.is-drag { border-color: var(--escf-primary); background: rgba(var(--escf-primary-rgb), .05); }
.escf-drop:focus-within { border-color: var(--escf-primary); box-shadow: 0 0 0 4px rgba(var(--escf-primary-rgb), .15); }
.escf-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.escf-drop__icon svg { width: 30px; height: 30px; fill: none; stroke: var(--escf-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.escf-drop__text { font-size: 13px; color: var(--escf-muted); word-break: break-all; line-height: 1.4; position: relative; z-index: 1; }
.escf-drop__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.escf-drop.has-file { border-style: solid; border-color: var(--escf-success); background: rgba(27, 138, 75, .05); }
.escf-drop.has-file .escf-drop__text { color: var(--escf-text); font-weight: 600; }
.escf-drop.has-file .escf-drop__icon { display: none; }

/* Repeater */
.escf-repeater {
	padding: 16px 18px;
	border: 1px solid #e3e8ef;
	border-radius: 12px;
	background: #fbfcfe;
}
.escf-repeater__title { margin: 0 0 12px; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--escf-navy); }
.escf-repeater__row {
	position: relative;
	padding: 14px;
	margin-bottom: 12px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid #edf0f4;
}
.escf-repeater__row .escf-grid { row-gap: 12px; }
.escf .escf-repeater__remove,
.escf .escf-repeater__add {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding: 7px 14px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
}
.escf .escf-repeater__add { color: var(--escf-primary); background: rgba(var(--escf-primary-rgb), .08); border: 1px solid rgba(var(--escf-primary-rgb), .25); }
.escf .escf-repeater__add:hover { background: rgba(var(--escf-primary-rgb), .15); }
.escf .escf-repeater__remove { color: var(--escf-error); background: transparent; border: 1px solid rgba(198, 40, 40, .3); }
.escf .escf-repeater__remove:hover { background: rgba(198, 40, 40, .06); }
.escf-repeater__row:only-child .escf-repeater__remove { display: none; }

/* Errors */
.escf-error { display: none; margin-top: 6px; font-size: 13px; color: var(--escf-error); }
.escf-field.is-invalid .escf-error, .escf-repeater.is-invalid > .escf-error { display: block; }
.escf-field.is-invalid .escf-input,
.escf-field.is-invalid .escf-drop,
.escf-field.is-invalid .escf-choice { border-color: var(--escf-error); }
.escf-field.is-invalid .escf-input { background: #fff8f8; }

.escf-alert {
	margin-top: 20px;
	padding: 12px 16px;
	border-radius: var(--escf-radius);
	background: #fdecea;
	color: var(--escf-error);
	font-size: 14px;
	font-weight: 600;
}

/* Submit */
.escf-actions { margin-top: 26px; }
.escf .escf-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 200px;
	min-height: 52px;
	padding: 12px 32px;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background: var(--escf-primary);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(var(--escf-primary-rgb), .3);
	transition: background-color .15s, transform .15s, box-shadow .15s;
	text-transform: none;
}
.escf .escf-submit:hover { background: var(--escf-navy); transform: translateY(-1px); }
.escf .escf-submit:focus-visible { outline: 3px solid rgba(var(--escf-primary-rgb), .4); outline-offset: 3px; }
.escf .escf-submit[disabled] { opacity: .75; cursor: progress; transform: none; }
.escf-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: escf-spin .8s linear infinite;
}
.escf-submit.is-loading .escf-spinner { display: inline-block; }
@keyframes escf-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .escf .escf-submit { width: 100%; } }

/* Success */
.escf-success {
	padding: 48px 24px;
	text-align: center;
	background: #fff;
	border: 1px solid #e7ebf1;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(16, 18, 103, .06);
	outline: none;
}
.escf-success__icon { width: 72px; height: 72px; margin: 0 auto 14px; display: block; }
.escf-success__icon circle { stroke: var(--escf-success); stroke-width: 2; stroke-dasharray: 160; stroke-dashoffset: 160; animation: escf-draw .6s ease-out forwards; }
.escf-success__icon path { stroke: var(--escf-success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: escf-draw .4s .5s ease-out forwards; }
.escf-success__text { margin: 0 auto; max-width: 520px; font-size: 17px; font-weight: 600; color: var(--escf-navy); }
@keyframes escf-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
	.escf-success__icon circle, .escf-success__icon path { animation: none; stroke-dashoffset: 0; }
	.escf .escf-submit:hover { transform: none; }
}

/* Honeypot */
.escf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.escf [hidden] { display: none !important; }
