/*!
 * Tobalt School News — front-end form styles
 * Author: Tobalt — https://tobalt.lt
 *
 * Tactical defaults — designed to inherit theme typography while staying
 * legible inside Elementor / Hello / Twenty Twenty-X.
 */

.tobalt-sn-form {
	max-width: 720px;
	margin: 0 auto;
	font-size: 1rem;
	line-height: 1.5;
}

.tobalt-sn-form fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 1.5em;
}

.tobalt-sn-step__legend {
	font-size: 1.15rem;
	font-weight: 600;
	margin: 0 0 0.75em;
	padding: 0;
}

.tobalt-sn-field {
	display: block;
	margin: 0 0 1.25em;
}

.tobalt-sn-field > label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35em;
}

.tobalt-sn-field input[type="text"],
.tobalt-sn-field input[type="email"],
.tobalt-sn-field input[type="number"],
.tobalt-sn-field input[type="date"],
.tobalt-sn-field input[type="url"],
.tobalt-sn-field input[type="file"],
.tobalt-sn-field select,
.tobalt-sn-field textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.55em 0.7em;
	border: 1px solid #c0c4c9;
	border-radius: 4px;
	font: inherit;
	background: #fff;
}

.tobalt-sn-field textarea {
	min-height: 6em;
	resize: vertical;
}

.tobalt-sn-field input:focus,
.tobalt-sn-field select:focus,
.tobalt-sn-field textarea:focus {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
	border-color: #2271b1;
}

.tobalt-sn-help {
	display: block;
	margin-top: 0.35em;
	color: #555;
	font-size: 0.875em;
}

.tobalt-sn-req {
	color: #b32d2e;
	margin-left: 0.15em;
}

.tobalt-sn-consent label {
	display: flex;
	gap: 0.65em;
	align-items: flex-start;
	font-weight: 400;
}

.tobalt-sn-consent input[type="checkbox"] {
	margin-top: 0.25em;
	flex-shrink: 0;
}

.tobalt-sn-submit,
.tobalt-sn-nav {
	display: flex;
	gap: 0.75em;
	margin-top: 1em;
	flex-wrap: wrap;
}

.tobalt-sn-button {
	font-weight: 600;
}

/* Honeypot — hidden but reachable to bots. */
.tobalt-sn-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Multi-step: hide non-active steps via JS toggling. */
.tobalt-sn-form--multi .tobalt-sn-step { display: none; }
.tobalt-sn-form--multi .tobalt-sn-step.is-active { display: block; }

/* Alerts. */
.tobalt-sn-alert {
	padding: 1em 1.25em;
	border-radius: 4px;
	margin: 0 auto 1.5em;
	max-width: 720px;
	border-left: 4px solid;
}

.tobalt-sn-alert--success {
	background: #edf7ee;
	border-color: #46a14a;
	color: #1f5023;
}

.tobalt-sn-alert--error {
	background: #fdeded;
	border-color: #d9534f;
	color: #6f1f1d;
}

.tobalt-sn-alert ul {
	margin: 0.5em 0 0 1.25em;
}

/* AI assistant UI. */
.tobalt-sn-ai-toolbar {
	display: flex;
	gap: 0.5em;
	flex-wrap: wrap;
	margin-top: 0.5em;
}

.tobalt-sn-ai-btn {
	background: #f6f7f7;
	border: 1px solid #c0c4c9;
	border-radius: 4px;
	padding: 0.4em 0.8em;
	cursor: pointer;
	font: inherit;
	font-size: 0.9em;
}

.tobalt-sn-ai-btn:hover { background: #ebebeb; }
.tobalt-sn-ai-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.tobalt-sn-ai-disclaimer {
	margin-top: 0.5em;
	font-size: 0.85em;
	color: #555;
	font-style: italic;
}

.tobalt-sn-ai-preview {
	margin-top: 0.75em;
	padding: 0.75em;
	background: #f6f7f7;
	border-left: 3px solid #2271b1;
	border-radius: 0 4px 4px 0;
}

.tobalt-sn-ai-preview__text {
	white-space: pre-wrap;
	margin: 0 0 0.5em;
}

.tobalt-sn-ai-preview__actions {
	display: flex;
	gap: 0.5em;
	flex-wrap: wrap;
}

/* -------------------------------------------------------------------- */
/* Trigger button (display="button" mode)                                */
/* -------------------------------------------------------------------- */

.tobalt-sn-trigger-wrap {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5em;
}

.tobalt-sn-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	padding: 0;
	border: 2px solid currentColor;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.tobalt-sn-trigger:hover,
.tobalt-sn-trigger:focus-visible {
	background: currentColor;
	outline: none;
}

.tobalt-sn-trigger:hover .tobalt-sn-trigger__icon,
.tobalt-sn-trigger:focus-visible .tobalt-sn-trigger__icon {
	color: #fff;
}

.tobalt-sn-trigger:focus-visible {
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.35);
}

.tobalt-sn-trigger:active {
	transform: scale(0.97);
}

.tobalt-sn-trigger__icon {
	flex-shrink: 0;
	color: inherit;
}

.tobalt-sn-trigger__label {
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
}

/* -------------------------------------------------------------------- */
/* Modal dialog                                                          */
/* -------------------------------------------------------------------- */

.tobalt-sn-modal {
	width: min(720px, 92vw);
	max-height: 90vh;
	margin: auto;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

.tobalt-sn-modal::backdrop {
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.tobalt-sn-modal__inner {
	position: relative;
	max-height: 90vh;
	overflow-y: auto;
	padding: 1.75em 1.75em 1.5em;
}

.tobalt-sn-modal__title {
	margin: 0 2em 1em 0;
	font-size: 1.4rem;
	font-weight: 600;
	line-height: 1.3;
}

.tobalt-sn-modal__close {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #555;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.tobalt-sn-modal__close:hover,
.tobalt-sn-modal__close:focus-visible {
	background: #f0f0f1;
	color: #1d2327;
	outline: none;
}

.tobalt-sn-modal__body .tobalt-sn-form {
	max-width: none; /* fill the modal width */
	margin: 0;
}

@media (max-width: 600px) {
	.tobalt-sn-modal {
		width: 100vw;
		max-height: 100vh;
		border-radius: 0;
	}
	.tobalt-sn-modal__inner {
		max-height: 100vh;
		padding: 1.25em;
	}
}
