/* ══════════════════════════════════════════════
   Survey Engine — Shared Styles
   ══════════════════════════════════════════════ */

.survey-header {
	text-align: center;
	margin-bottom: 50px;
}

.survey-header h1 {
	font-size: 35px;
	color: #555;
	margin-bottom: 10px;
}

.survey-header p {
	margin-bottom: 0;
	font-weight: 300;
	font-size: 18px;
	line-height: 26px;
	letter-spacing: 2%;
	vertical-align: middle;
	color: #555;
}

/* Personal Details */
.personal-details {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px 15px;
	margin-bottom: 50px;
	border-radius: 8px;
}

.personal-details .form-group {
	display: flex;
	flex-direction: column;
}

.personal-details .form-group.full-width {
	grid-column: 1 / -1;
}

.personal-details label {
	color: #555;
	margin-bottom: 5px;
	font-weight: 400;
	font-size: 13px;
	line-height: 21px;
	letter-spacing: 2%;
	vertical-align: middle;
}

.personal-details label .required {
	color: #555;
}

.personal-details input {
	background: transparent;
	border: none;
	border-bottom: 1px solid #555;
	color: black;
	padding: 0 0 10px 0;
	border-radius: 0;
	outline: none;
	transition: border-color 0.2s;
	font-weight: 400;
	font-size: 21px;
	line-height: 23px;
	letter-spacing: 2%;
	vertical-align: middle;
}

.personal-details input:focus {
	border-color: #555;
}

/* Question sections */
.question-section {
	margin-bottom: 25px;
}

.question-section .section-title {
	font-size: 23px;
	font-weight: 500;
	color: #555;
	margin-bottom: 15px;
}

.question-section .section-content {
	font-size: 14px;
	color: #555;
	margin-top: 15px;
	margin-bottom: 50px;
}

.question-section .section-content p {
	margin-bottom: 0;
	font-weight: 300;
	font-size: 18px;
	line-height: 26px;
	letter-spacing: 2%;
	vertical-align: middle;
}

.question-section .section-content b {
	color: #555;
	font-weight: 400;
	font-size: 36px;
	line-height: 44px;
	letter-spacing: 2%;
	vertical-align: middle;
}

.question-section .section-content a {
	color: #555;
	text-decoration: underline;
	cursor: pointer;
	font-weight: 600;
}

/* Separator */
.section-separator {
	border: none;
	border-top: 1px solid #333;
	margin: 30px 0;
}

.section-separator:last-of-type {
	display: none;
}

/* Boolean (True/False) rows */
.boolean-group {
	margin-bottom: 5px;
}

.boolean-row {
	margin-bottom: 12px;
}

.boolean-row-label {
	font-size: 16px;
	color: #555;
	margin-bottom: 8px;
}

.boolean-buttons {
	display: flex;
	gap: 8px;
}

.boolean-btn {
	padding: 10px 30px;
	border: 1px solid #555;
	background: transparent;
	color: #555;
	border-radius: 4px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	transition: all 0.2s;
}

.boolean-btn:hover {
	background: rgba(202, 182, 131, 0.1);
}

.boolean-btn.active-yes,
.boolean-btn.active-no {
	background: #555;
	color: white;
	border-color: #555;
}

/* Multiple choice checkboxes */
.checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.checkbox-item {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	width: 24px;
	height: 24px;
	min-width: 24px;
	min-height: 24px;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	position: relative;
	cursor: pointer;
}

.checkbox-item input[type="checkbox"]::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 24px;
	height: 24px;
	border: 1px solid #555;
	border-radius: 4px;
	background: transparent;
	box-sizing: border-box;
}

.checkbox-item input[type="checkbox"]:checked::after {
	content: '';
	background: #555 url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.512939 4.29712L4.51294 8.04712L12.5129 0.547119' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat 5px 7px;
}

.checkbox-item label {
	font-size: 16px;
	color: #555;
	cursor: pointer;
}

/* Select (button grid) */
.select-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.select-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 16px 20px;
	border: 1px solid #555;
	border-radius: 4px;
	background: transparent;
	color: #555;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	min-height: 54px;
}

.select-btn:hover {
	background: rgba(202, 182, 131, 0.1);
}

.select-btn.selected {
	background: #555;
	color: white;
	border-color: #555;
}

.select-btn input {
	display: none;
}

/* Consents */
.consent-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.consent-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.consent-item input[type="checkbox"] {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	width: 24px;
	height: 24px;
	min-width: 24px;
	min-height: 24px;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	margin-top: 3px;
	position: relative;
	cursor: pointer;
}

.consent-item input[type="checkbox"]::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 24px;
	height: 24px;
	border: 1px solid #555;
	border-radius: 4px;
	background: transparent;
	box-sizing: border-box;
}

.consent-item input[type="checkbox"]:checked::after {
	content: '';
	background: #555 url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.512939 4.29712L4.51294 8.04712L12.5129 0.547119' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat 5px 7px;
}

.consent-item input[type="checkbox"].field-error::after {
	border-color: #e74c3c;
}

.consent-item label {
	font-size: 16px;
	color: #555;
	cursor: pointer;
}

.consent-item a {
	color: #555;
	text-decoration: underline;
	font-weight: 600;
}

/* Info type */
.info-block {
	margin-bottom: 10px;
}

.info-block p {
	margin-bottom: 8px;
}

.info-block a {
	color: #555;
	text-decoration: underline;
	cursor: pointer;
	font-weight: 600;
}

/* Follow-up blocks */
.followup-block {
	display: none;
	margin-top: 10px;
	padding: 15px;
	border-left: 3px solid #555;
	background: #555;
	border-radius: 0 6px 6px 0;
}

.followup-block.visible {
	display: block;
}

.followup-label {
	font-size: 13px;
	font-weight: 700;
	color: #ddd;
	margin-bottom: 6px;
}

.followup-textarea {
	width: 100%;
	border: 1px solid #555;
	color: #555;
	padding: 10px 12px;
	border-radius: 5px;
	font-size: 14px;
	font-family: 'Open Sans', sans-serif;
	resize: vertical;
	min-height: 80px;
	outline: none;
	transition: border-color 0.2s;
}

.followup-textarea:focus {
	border-color: #555;
}

.followup-info,
.followup-info p {
	font-size: 14px;
	color: #bbb;
}

.followup-info a {
	color: white;
	text-decoration: underline;
	cursor: pointer;
	font-weight: 600;
}

/* Textarea question type */
.textarea-input {
	width: 100%;
	font-family: 'Open Sans', sans-serif;
	resize: vertical;
	min-height: 100px;
	background: transparent;
	border: none;
	border-bottom: 1px solid #555;
	color: black;
	padding: 0 0 10px 0;
	border-radius: 0;
	outline: none;
	transition: border-color 0.2s;
	font-weight: 400;
	font-size: 21px;
	line-height: 23px;
	letter-spacing: 2%;
	vertical-align: middle;
	max-width: 550px;
}

.textarea-input:focus {
	border-color: #555;
}

/* Input text question type */
.inputtext-input {
	background: transparent;
	border: none;
	border-bottom: 1px solid #555;
	color: black;
	padding: 0 0 10px 0;
	border-radius: 0;
	outline: none;
	transition: border-color 0.2s;
	font-weight: 400;
	font-size: 21px;
	line-height: 23px;
	letter-spacing: 2%;
	vertical-align: middle;
	width: 100%;
	max-width: 550px;
}

.inputtext-input:focus {
	border-color: #555;
}

/* Date */
.date-input {
	background: transparent;
	border: none;
	border-bottom: 1px solid #555;
	color: black;
	padding: 0 30px 10px 0;
	border-radius: 0;
	outline: none;
	transition: border-color 0.2s;
	font-weight: 400;
	font-size: 21px;
	line-height: 23px;
	letter-spacing: 2%;
	vertical-align: middle;
	cursor: pointer;
	position: relative;
	width: 100%;
}

.date-input::-webkit-calendar-picker-indicator {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.date-input-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
	max-width: 550px;
}

.personal-details .date-input-wrapper {
	max-width: unset;
}

.date-input-wrapper::after {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-60%);
	width: 24px;
	height: 24px;
	background: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.1644 5.65771H19.9408V3.77393H21.4408V5.65771H27.9672C28.3814 5.65771 28.7172 5.9935 28.7172 6.40771V27.77C28.7171 28.1842 28.3814 28.52 27.9672 28.52H3.5199C3.1057 28.52 2.76992 28.1842 2.7699 27.77V6.40771C2.7699 5.9935 3.10568 5.65771 3.5199 5.65771H9.66443V3.77393H11.1644V5.65771ZM4.2699 14.0249V27.02H27.2172V14.0249H4.2699ZM4.2699 12.5249H27.2172V7.15771H21.4408V8.69873H19.9408V7.15771H11.1644V8.69873H9.66443V7.15771H4.2699V12.5249Z' fill='%23A7A8AA'/%3E%3Cpath d='M7.16321 20.1689H9.94796' stroke='%23A7A8AA' stroke-width='1.5'/%3E%3Cpath d='M12.2686 20.1689H15.0533' stroke='%23A7A8AA' stroke-width='1.5'/%3E%3Cpath d='M7.16321 23.4365H9.94796' stroke='%23A7A8AA' stroke-width='1.5'/%3E%3Cpath d='M12.2686 23.4365H15.0533' stroke='%23A7A8AA' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat center center;
	background-size: contain;
	pointer-events: none;
}

.date-input:focus {
	border-color: #555;
}

/* Signature */
.signature-wrapper {
	margin-top: 5px;
}

/* Touch device: show canvas, hide QR */
.signature-wrapper.hasTouchscreen .signature-qr-container {
	display: none;
}

/* Desktop: show QR, hide canvas */
.signature-wrapper.hasMouse .signature-canvas-container {
	display: none;
}
.signature-wrapper.hasMouse .signature-qr-container {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.signature-canvas-container {
	position: relative;
}

.signature-canvas {
	border: 1px solid #555;
	border-radius: 5px;
	background: transparent;
	cursor: crosshair;
	display: block;
	width: 100%;
	max-width: 550px;
	height: 200px;
	touch-action: none;
	box-sizing: border-box;
}

.signature-canvas.field-error {
	border-color: #e74c3c;
}

/* QR code container */
.signature-qr-container {
	display: none;
}

.signature-qr-wrapper {
	border: 1px solid #555;
	border-radius: 5px;
	padding: 20px;
	display: inline-block;
	background: rgba(255,255,255,0.03);
}

.signature-qr-wrapper.field-error {
	border-color: #e74c3c;
}

.signature-qr-wrapper img.qr-image {
	display: block;
	max-height: 250px;
}

.signature-qr-label {
	font-size: 13px;
	color: #999;
	margin-top: 8px;
}

.signature-qr-label.saved-label {
	color: #2ecc71;
}

.signature-saved-img {
	border: 1px solid #555;
	border-radius: 5px;
	max-width: 550px;
	max-height: 200px;
	display: block;
}

.signature-actions {
	margin-top: 8px;
	display: flex;
	gap: 8px;
}

.signature-actions button {
	padding: 7px 22px;
	border: 1px solid #555;
	background: transparent;
	color: #555;
	border-radius: 4px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	transition: all 0.2s;
}

.signature-actions button:hover {
	background: #555;
	color: white;
	border-color: #555;
}

/* Existing signature image (edit flow) */
.signature-existing {
	margin-bottom: 8px;
}

.signature-existing img {
	border: 1px solid #555;
	border-radius: 5px;
	max-width: 550px;
	max-height: 200px;
	display: block;
}

/* Success message */
.survey-success-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 20px;
	text-align: center;
}

.survey-success-message svg {
	margin-bottom: 0;
}

.survey-success-message h2 {
	color: #555;
	font-size: 22px;
	font-weight: 600;
	margin: 0;
	line-height: 1.4;
}

/* Status banner (admin edit mode) */
.survey-status-banner {
	background: rgba(202, 182, 131, 0.1);
	border: 1px solid #555;
	border-radius: 6px;
	padding: 14px 20px;
	color: #555;
	font-size: 14px;
	line-height: 1.6;
	margin-bottom: 30px;
}

/* Submit */
.submit-section {
	text-align: center;
	margin-top: 40px;
}

.submit-btn {
	padding: 14px 50px;
	border: solid 1px #555;
	background: #555;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s;
}

.submit-btn:hover {
	background: #d1d1d1;
	color: black;
}

/* Loading */
.survey-loading {
	text-align: center;
	padding: 60px;
	color: #888;
	font-size: 16px;
}

/* Field error */
.field-error {
	border-color: #e74c3c !important;
}

.error-msg {
	color: #e74c3c;
	font-size: 12px;
	margin-top: 4px;
}

/* Read-only mode */
.survey-readonly .boolean-btn {
	pointer-events: none;
	opacity: 0.85;
}

.survey-readonly .checkbox-item input[type="checkbox"],
.survey-readonly .consent-item input[type="checkbox"] {
	pointer-events: none;
}

.survey-readonly .checkbox-item label,
.survey-readonly .consent-item label {
	pointer-events: none;
}

.survey-readonly .select-btn {
	pointer-events: none;
	opacity: 0.85;
}

.survey-readonly .textarea-input,
.survey-readonly .inputtext-input,
.survey-readonly .date-input,
.survey-readonly .followup-textarea {
	pointer-events: none;
	opacity: 0.85;
}

.survey-readonly .signature-canvas {
	pointer-events: none;
}

.survey-readonly .signature-qr-container {
	pointer-events: none;
}

.survey-readonly .signature-actions {
	display: none;
}

.survey-readonly .consent-select-all {
	display: none;
}

/* Responsive */
@media (max-width: 768px) {
	.personal-details {
		grid-template-columns: 1fr;
		padding: 15px;
		gap: 25px 12px;
	}

	.personal-details input {
		font-size: 16px;
	}

	.select-group {
		grid-template-columns: 1fr;
	}

	.select-btn {
		padding: 12px 16px;
		min-height: 48px;
	}
}
