/* ── Modal overlay ─────────────────────────────────────────────────────────── */

.csl-modal {
	position: fixed;
	inset: 0;
	z-index: var(--z-index-modal, 100);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.csl-modal[hidden] {
	display: none;
}

.csl-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.csl-modal__box {
	position: relative;
	background: var(--color-card, #fff);
	border-radius: var(--radius-xl, 1.5rem);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
	padding: 2.5rem 2rem;
	width: 100%;
	max-width: 440px;
	max-height: 90vh;
	overflow-y: auto;
}

.csl-modal__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: var(--color-muted, #e8eef2);
	border: none;
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--color-foreground, #1a1a2e);
	transition: background 0.15s;
}

.csl-modal__close:hover {
	background: var(--color-border, rgba(0, 47, 68, 0.15));
}

.csl-modal__eyebrow {
	font-size: 0.75rem;
	font-weight: var(--font-weight-medium, 600);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-secondary, #b8f51e);
	margin: 0 0 0.5rem;
}

.csl-modal__title {
	font-size: 1.5rem;
	font-weight: var(--font-weight-bold, 700);
	color: var(--color-foreground, #1a1a2e);
	margin: 0 0 0.5rem;
	line-height: 1.25;
}

.csl-modal__subtitle {
	font-size: 0.9375rem;
	color: var(--color-muted-foreground, #64748b);
	margin: 0 0 1.5rem;
	line-height: 1.5;
}

/* ── Form wrapper ──────────────────────────────────────────────────────────── */

.csl-wrap {
	width: 100%;
}

.csl-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* ── Fields ────────────────────────────────────────────────────────────────── */

.csl-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.csl-label {
	font-size: 0.875rem;
	font-weight: var(--font-weight-medium, 600);
	color: var(--color-foreground, #1a1a2e);
}

.csl-input {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 0.9375rem;
	font-family: var(--font-family-base, system-ui, sans-serif);
	color: var(--color-foreground, #1a1a2e);
	background: var(--color-background, #fafbfc);
	border: 1.5px solid var(--color-border, rgba(0, 47, 68, 0.15));
	border-radius: var(--radius-md, 0.75rem);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.csl-input::placeholder {
	color: var(--color-muted-foreground, #94a3b8);
}

.csl-input:focus {
	border-color: var(--color-primary, #002f44);
	box-shadow: 0 0 0 3px rgba(0, 47, 68, 0.1);
}

/* ── Message ───────────────────────────────────────────────────────────────── */

.csl-msg {
	font-size: 0.875rem;
	min-height: 1.25rem;
}

.csl-msg--error {
	color: #dc2626;
}

.csl-msg--success {
	color: #16a34a;
}

/* ── Submit button ─────────────────────────────────────────────────────────── */

.csl-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: var(--font-weight-medium, 600);
	font-family: var(--font-family-base, system-ui, sans-serif);
	color: var(--color-secondary-foreground, #002f44);
	background: var(--color-secondary, #b8f51e);
	border: none;
	border-radius: var(--radius-md, 0.75rem);
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
	margin-top: 0.25rem;
}

.csl-btn:hover:not(:disabled) {
	opacity: 0.9;
}

.csl-btn:active:not(:disabled) {
	transform: scale(0.98);
}

.csl-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */

.csl-btn__spinner {
	display: none;
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

.csl-btn--loading .csl-btn__spinner {
	display: block !important;
	animation: csl-spin 0.7s linear infinite;
}

.csl-btn--loading .csl-btn__text {
	display: none !important;
}

@keyframes csl-spin {
	to { transform: rotate(360deg); }
}

/* ── Standalone shortcode (not in modal) ───────────────────────────────────── */

.csl-wrap:not(.csl-modal__box .csl-wrap) {
	max-width: 480px;
}
