/* ==========================================================================
   survey-public.css — public renderer ankiet (subdomena www).
   Mobile-first, czyste klasy .survey-* bez kolizji z innymi modulami.
   ========================================================================== */

.survey-wrapper {
	max-width: 720px;
	margin: 32px auto;
	padding: 0 16px;
}

.survey-card {
	background: #fff;
	border: 1px solid #eef0f2;
	border-radius: 16px;
	padding: 32px 28px;
	box-shadow: 0 2px 12px rgba(56, 64, 71, 0.04);
}

.survey-title {
	font-size: 26px;
	font-weight: 800;
	color: #384047;
	margin: 0 0 16px;
	line-height: 1.25;
}

.survey-intro-text {
	font-size: 15px;
	line-height: 1.6;
	color: #6b747c;
	margin: 0 0 24px;
}

.survey-reward-banner {
	background: linear-gradient(135deg, #e6f8f2 0%, #fff 100%);
	border: 1.5px solid #2AC59B;
	border-radius: 12px;
	padding: 14px 18px;
	font-size: 15px;
	color: #1f9a78;
	margin: 0 0 20px;
}

.survey-deadline {
	font-size: 13px;
	color: #98a0a6;
	margin: 0 0 24px;
}

.survey-anonymity-note {
	display: block;
	font-size: 12px;
	color: #98a0a6;
	margin-top: 20px;
	line-height: 1.5;
}

.survey-start-form {
	margin: 24px 0 0;
}

/* Przyciski */
.survey-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	padding: 14px 28px;
	border-radius: 12px;
	border: 1.5px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .16s ease, border-color .16s ease, transform .08s ease;
}
.survey-btn:active { transform: translateY(1px); }

.survey-btn-primary {
	background: #2AC59B;
	border-color: #2AC59B;
	color: #fff;
}
.survey-btn-primary:hover,
.survey-btn-primary:focus {
	background: #4ad8b2;
	border-color: #4ad8b2;
	color: #fff;
}

.survey-btn-secondary {
	background: #fff;
	border-color: #2AC59B;
	color: #1f9a78;
}
.survey-btn-secondary:hover,
.survey-btn-secondary:focus {
	background: #f2fbf8;
	color: #1f9a78;
}

.survey-closed .survey-closed-msg {
	font-size: 15px;
	line-height: 1.6;
	color: #6b747c;
	margin: 16px 0 24px;
}

/* ==========================================================================
   Progress bar
   ========================================================================== */
.survey-progress {
	margin: 0 0 16px;
}
.survey-progress-bar {
	height: 4px;
	background: #2AC59B;
	border-radius: 2px;
	transition: width .3s ease;
}
.survey-progress-label {
	display: block;
	margin-top: 6px;
	color: #98a0a6;
	font-size: 12px;
}

/* ==========================================================================
   Sekcja z pytaniami
   ========================================================================== */
.survey-section { margin: 0; }

.survey-question {
	padding: 20px 0;
	border-bottom: 1px solid #eef0f2;
}
.survey-question:last-of-type { border-bottom: none; }

.survey-question-label {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: #384047;
	line-height: 1.4;
	margin-bottom: 4px;
}
.survey-q-num {
	color: #98a0a6;
	margin-right: 4px;
}
.survey-required {
	color: #b94a48;
	margin-left: 4px;
}
.survey-question-desc {
	font-size: 13px;
	color: #6b747c;
	margin-bottom: 12px;
	line-height: 1.5;
}
.survey-question-input { margin-top: 12px; }
.survey-question-error {
	color: #b94a48;
	font-size: 13px;
	margin-top: 8px;
	padding: 8px 12px;
	background: #fef0ee;
	border-radius: 6px;
}
.survey-question-invalid .survey-input,
.survey-question-invalid input:not([type="radio"]):not([type="checkbox"]),
.survey-question-invalid textarea { border-color: #b94a48 !important; box-shadow: 0 0 0 2px #b94a4820; }
.survey-question-invalid .survey-question-label { color: #b94a48; }

/* ==========================================================================
   Opcje (SINGLE / MULTI)
   ========================================================================== */
.survey-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border: 1.5px solid #eef0f2;
	border-radius: 10px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
.survey-option:hover { background: #f7f8f9; border-color: #d8e1e6; }
.survey-option input[type="radio"],
.survey-option input[type="checkbox"] {
	flex: 0 0 auto;
	margin-top: 2px;
	cursor: pointer;
}
.survey-option input:checked + span {
	font-weight: 600;
	color: #1f9a78;
}
.survey-option:has(input:checked) {
	border-color: #2AC59B;
	background: #f2fbf8;
}
.survey-option span {
	flex: 1;
	min-width: 0;
	font-size: 15px;
	line-height: 1.4;
	color: #384047;
}

.survey-other-input {
	display: none;
	width: 100%;
	margin-top: 8px;
	padding: 8px 10px;
	border: 1px solid #dde2e6;
	border-radius: 6px;
	font-size: 14px;
}

/* ==========================================================================
   Skala
   ========================================================================== */
.survey-scale {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.survey-scale-values {
	display: flex;
	gap: 6px;
	justify-content: space-between;
}
.survey-scale-value {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 8px 4px;
	border: 1.5px solid #eef0f2;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
	font-weight: 600;
	color: #6b747c;
}
.survey-scale-value:hover { background: #f7f8f9; }
.survey-scale-value:has(input:checked) {
	border-color: #2AC59B;
	background: #2AC59B;
	color: #fff;
}
.survey-scale-value input { display: none; }

.survey-scale-label-min,
.survey-scale-label-max {
	font-size: 14px;
	color: #555;
	font-weight: 500;
	display: block;
	margin: 4px 2px;
}
.survey-scale-label-min { text-align: left; }
.survey-scale-label-max { text-align: right; }

/* ==========================================================================
   Pola tekstowe / liczbowe
   ========================================================================== */
.survey-input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid #dde2e6;
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
	color: #384047;
	background: #fff;
	transition: border-color .15s ease;
}
.survey-input:focus {
	outline: none;
	border-color: #2AC59B;
	box-shadow: 0 0 0 3px rgba(42, 197, 155, 0.15);
}
.survey-textarea {
	resize: vertical;
	min-height: 100px;
	line-height: 1.5;
}
.survey-input-number {
	max-width: 200px;
}

/* ==========================================================================
   Bramka
   ========================================================================== */
.survey-gate {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 2px dashed #d8e1e6;
}
.survey-gate-prompt {
	font-size: 15px;
	color: #384047;
	line-height: 1.5;
	margin-bottom: 16px;
}
.survey-gate-option {
	font-weight: 600;
}

/* ==========================================================================
   Akcje (submit)
   ========================================================================== */
.survey-actions {
	margin-top: 28px;
	display: flex;
	justify-content: flex-end;
}

/* ==========================================================================
   Ekrany koncowe (A bez kodu, B z kodem)
   ========================================================================== */
.survey-end {
	text-align: center;
}

.survey-end-icon {
	font-size: 56px;
	width: 88px;
	height: 88px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: #e6f8f2;
	color: #1f9a78;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.survey-end-icon-gift {
	background: linear-gradient(135deg, #fff7e0 0%, #fef0ee 100%);
	color: #ff8c00;
}

.survey-end-text {
	font-size: 15px;
	line-height: 1.6;
	color: #6b747c;
	margin: 0 auto 24px;
	max-width: 480px;
}

.survey-end-bonus .survey-title {
	color: #1f9a78;
}

.survey-reward-code-box {
	margin: 24px auto;
	max-width: 480px;
	padding: 20px 24px;
	text-align: center;
}

.survey-reward-label {
	font-size: 13px;
	color: #6b747c;
	margin-bottom: 8px;
	font-weight: 600;
}

.survey-reward-code {
	font-size: 28px;
	font-weight: 800;
	color: #1f9a78;
	font-family: 'Courier New', monospace;
	letter-spacing: 2px;
	user-select: all;
	padding: 8px 16px;
	background: #fff;
	border-radius: 8px;
	display: inline-block;
}

.survey-reward-deadline {
	display: block;
	margin-top: 8px;
	color: #98a0a6;
	font-size: 12px;
}

.survey-code {
	color: #1f9a78;
	font-weight: 800;
	font-family: 'Courier New', monospace;
	letter-spacing: 2px;
}

/* Email form */
.survey-email-form {
	margin: 24px auto;
	max-width: 480px;
	text-align: left;
	padding: 20px;
	background: #f7f8f9;
	border-radius: 12px;
}
.survey-email-label {
	display: block;
	font-weight: 700;
	color: #384047;
	margin-bottom: 4px;
}
.survey-email-note {
	display: block;
	font-size: 12px;
	color: #98a0a6;
	margin-bottom: 12px;
	line-height: 1.5;
}
.survey-email-row {
	display: flex;
	gap: 8px;
}
.survey-email-row .survey-input { flex: 1; }
.survey-email-saved {
	margin: 24px auto;
	max-width: 480px;
	padding: 12px 16px;
	background: #e6f8f2;
	border: 1.5px solid #2AC59B;
	border-radius: 8px;
	color: #1f9a78;
	text-align: center;
	font-weight: 600;
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 540px) {
	.survey-wrapper { margin: 16px auto; padding: 0 12px; }
	.survey-card { padding: 24px 18px; border-radius: 12px; }
	.survey-title { font-size: 22px; }
	.survey-btn { width: 100%; padding: 14px 20px; }
	.survey-actions { justify-content: stretch; }
	.survey-scale-values { gap: 4px; }
	.survey-scale-value { padding: 8px 2px; font-size: 14px; }
}

/* ==========================================================================
   Loading overlay (spinner) - pokazywany podczas submitu sekcji
   ========================================================================== */
.survey-loading-overlay {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(255, 255, 255, 0.85);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}
.survey-loading-box {
	text-align: center;
	background: #fff;
	padding: 32px 48px;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.survey-spinner {
	width: 48px;
	height: 48px;
	margin: 0 auto 16px;
	border: 4px solid #e6f5f0;
	border-top-color: #2AC59B;
	border-radius: 50%;
	animation: surveySpin 0.8s linear infinite;
}
.survey-loading-text {
	font-size: 14px;
	color: #555;
	font-weight: 500;
}
@keyframes surveySpin {
	to { transform: rotate(360deg); }
}
