/* SW Forms — Front-end */

.swf-wrapper {
	--swf-primary: #7C3AED;
	--swf-secondary: #EC4899;
	--swf-text: #1A1A2E;
	--swf-radius: 14px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--swf-text);
}
.swf-wrapper *, .swf-wrapper *::before, .swf-wrapper *::after { box-sizing: border-box; }

.swf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: none; cursor: pointer; font-size: 15px; font-weight: 600; padding: 13px 26px;
	border-radius: var(--swf-radius); transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.swf-btn:active { transform: scale(.97); }
.swf-btn-primary { background: linear-gradient(135deg, var(--swf-primary), var(--swf-secondary)); color: #fff; box-shadow: 0 6px 16px -4px rgba(0,0,0,.25); }
.swf-btn-primary:hover { box-shadow: 0 8px 22px -4px rgba(0,0,0,.32); }
.swf-btn-primary:disabled { opacity: .6; cursor: default; transform: none; }
.swf-btn-ghost { background: transparent; color: inherit; opacity: .7; }
.swf-btn-ghost:hover { opacity: 1; }

.swf-shape-pill .swf-btn { border-radius: 999px; }
.swf-shape-square .swf-btn { border-radius: 4px; }

.swf-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.swf-required { color: #ef4444; margin-left: 3px; }

.swf-input {
	width: 100%; padding: 13px 16px; font-size: 15px; border: 1.5px solid #e2e2ea;
	border-radius: var(--swf-radius); background: #fff; color: var(--swf-text);
	transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.swf-input:focus {
	outline: none; border-color: var(--swf-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--swf-primary) 15%, transparent);
}
textarea.swf-input { resize: vertical; min-height: 100px; }

.swf-choice-group { display: flex; flex-direction: column; gap: 8px; }
.swf-choice {
	display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid #e2e2ea;
	border-radius: var(--swf-radius); cursor: pointer; transition: border-color .15s, background .15s;
}
.swf-choice:hover { border-color: var(--swf-primary); }
.swf-choice input { accent-color: var(--swf-primary); width: 17px; height: 17px; flex-shrink: 0; }
.swf-consent { font-size: 13px; opacity: .85; }

.swf-hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.swf-error-message {
	display: none; margin-top: 14px; padding: 12px 16px; background: #fef2f2; color: #b91c1c;
	border-radius: var(--swf-radius); font-size: 14px;
}
.swf-error-message.is-visible { display: block; }

.swf-success-icon {
	width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--swf-primary), var(--swf-secondary));
	color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 16px;
}

/* ---------------- Mode classique ---------------- */

.swf-mode-classic { max-width: 640px; }
.swf-mode-classic .swf-form { background: #fff; border-radius: calc(var(--swf-radius) + 6px); padding: 32px; border: 1px solid #eee; box-shadow: 0 2px 24px -8px rgba(0,0,0,.08); }
.swf-classic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.swf-classic-grid .swf-width-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .swf-classic-grid { grid-template-columns: 1fr; } .swf-classic-grid .swf-width-half { grid-column: 1 / -1; } }
.swf-classic-footer { margin-top: 24px; }
.swf-classic-footer .swf-btn { width: 100%; }
.swf-classic-success { display: none; text-align: center; padding: 20px 0; }
.swf-classic-success .swf-success-message { font-size: 16px; }
.swf-mode-classic.swf-is-submitted .swf-classic-grid,
.swf-mode-classic.swf-is-submitted .swf-classic-footer { display: none; }
.swf-mode-classic.swf-is-submitted .swf-classic-success { display: block; }

/* ---------------- Mode conversationnel (typeform) ---------------- */

.swf-mode-typeform {
	position: relative; border-radius: calc(var(--swf-radius) + 10px); overflow: hidden;
	min-height: 480px; display: flex; flex-direction: column; padding: 20px;
}
.swf-mode-typeform.swf-bg-gradient { background: linear-gradient(135deg, var(--swf-primary), var(--swf-secondary)); color: #fff; }
.swf-mode-typeform.swf-bg-solid { background: var(--swf-primary); color: #fff; }
.swf-mode-typeform.swf-bg-light { background: #fafafa; border: 1px solid #eee; }
.swf-mode-typeform.swf-bg-gradient .swf-input,
.swf-mode-typeform.swf-bg-solid .swf-input { background: rgba(255,255,255,.95); border-color: rgba(255,255,255,.4); color: #1a1a2e; }
.swf-mode-typeform.swf-bg-gradient .swf-choice,
.swf-mode-typeform.swf-bg-solid .swf-choice { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.swf-mode-typeform.swf-bg-gradient .swf-label,
.swf-mode-typeform.swf-bg-solid .swf-label { color: #fff; }
.swf-mode-typeform.swf-bg-gradient .swf-btn-ghost,
.swf-mode-typeform.swf-bg-solid .swf-btn-ghost { color: #fff; }
.swf-mode-typeform.swf-bg-gradient .swf-btn-primary,
.swf-mode-typeform.swf-bg-solid .swf-btn-primary { background: #fff; color: var(--swf-primary); }

.swf-progress { height: 4px; background: rgba(120,120,120,.2); border-radius: 4px; overflow: hidden; margin-bottom: 10px; flex-shrink: 0; }
.swf-progress-bar { height: 100%; width: 0; background: currentColor; opacity: .85; transition: width .3s ease; }

.swf-slides { position: relative; flex: 1; display: flex; }
.swf-slide {
	display: none; width: 100%; align-items: center; justify-content: center; padding: 30px 10px;
	animation: swf-fade-in .35s ease;
}
.swf-slide.swf-slide-active { display: flex; }
@keyframes swf-fade-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.swf-slide-inner { width: 100%; max-width: 480px; margin: 0 auto; }
.swf-slide-count { font-size: 12px; opacity: .7; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.swf-slide-inner .swf-label { font-size: 22px; margin: 10px 0 18px; line-height: 1.3; }
.swf-slide-nav { display: flex; gap: 10px; margin-top: 22px; }
.swf-hint { font-size: 12px; opacity: .6; margin-top: 14px; }

.swf-slide-success { text-align: center; }
.swf-slide-success .swf-success-message { font-size: 18px; }

.swf-mode-typeform.swf-is-submitted .swf-slide:not(.swf-slide-success) { display: none; }
.swf-mode-typeform.swf-is-submitted .swf-slide-success { display: flex; }
.swf-mode-typeform.swf-is-submitted .swf-progress { width: 0; opacity: 0; }

@media (max-width: 560px) {
	.swf-mode-typeform { min-height: 420px; padding: 16px; }
	.swf-slide-inner .swf-label { font-size: 19px; }
}
