/**
 * CSS for LW Simple Forms
 * Modern, responsive form styling that matches the sample HTML
 */

/* Global box-sizing reset */
* {
	box-sizing: border-box;
}

/* Common styles for all screens */
:root {
	--primary-color: #4a90e2;
	--secondary-color: #6c757d;
	--success-color: #28a745;
	--danger-color: #dc3545;
	--light-color: #f8f9fa;
	--dark-color: #343a40;
	--border-color: #dee2e6;
	--border-radius: 4px;
	--box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	--transition: all 0.3s ease;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	color: #333;
	background-color: #f5f7fa;
}

/* Form container styling */
.form-container {
	max-width: 800px;
	margin: 2rem auto;
	padding: 2rem;
	background-color: #fff;
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	box-sizing: border-box;
}

/* Form rows */
.form-row {
	margin-bottom: 1.5rem;
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* Labels */
label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--dark-color);
}

/* Required field indicator */
.required {
	color: var(--danger-color);
	margin-left: 0.2rem;
}

/* Field containers */
.field-container {
	position: relative;
	width: 100%;
	display: flex;
	flex-direction: column;
}

/* Basic form controls */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
	width: 100%;
	padding: 0.75rem;
	font-size: 1rem;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	background-color: #fff;
	transition: var(--transition);
	box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
	border-color: var(--primary-color);
	outline: none;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
}

/* Placeholders */
::placeholder {
	color: #adb5bd;
	opacity: 1;
}

/* Textarea */
textarea {
	min-height: 120px;
	resize: vertical;
}

/* Select boxes */
select {
	appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><path fill="%23666" d="M0 0l6 6 6-6z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 1rem center;
	padding-right: 2.5rem;
}

/* Radio and checkbox groups - UPDATED to display horizontally */
.radio-group,
.checkbox-group {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 0.5rem;
}

/* Radio and checkbox inline labels */
.radio-inline,
.checkbox-inline {
	display: flex;
	align-items: center;
	margin-right: 1rem;
	margin-bottom: 0.5rem;
	cursor: pointer;
}

/* Radio and checkbox inputs */
input[type="radio"],
input[type="checkbox"] {
	margin-right: 0.5rem;
	cursor: pointer;
}

/* Error messages */
.error {
	color: var(--danger-color);
	font-size: 0.875rem;
	margin-top: 0.5rem;
	display: block;
}

/* Privacy policy section */
.privacy-policy {
	margin-top: 1rem;
}

/* Button container */
.form-button {
	margin-top: 2rem;
	text-align: center;
}

/* Multiple buttons container */
.form-buttons {
	display: flex;
	justify-content: space-between;
	margin-top: 2rem;
}

/* Buttons */
button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 500;
	text-align: center;
	cursor: pointer;
	border: none;
	border-radius: var(--border-radius);
	transition: var(--transition);
	background-color: var(--primary-color);
	color: white;
}

button:hover {
	background-color: #3a7bc8;
}

button.back {
	background-color: var(--secondary-color);
}

button.back:hover {
	background-color: #5a6268;
}

button.send {
	background-color: var(--primary-color);
}

.back-button button {
	background-color: var(--secondary-color);
}

.back-button button:hover {
	background-color: #5a6268;
}

.submit-button button {
	background-color: var(--primary-color);
}

.submit-button button:hover {
	background-color: #3a7bc8;
}

/* Confirmation screen specific styles */
.confirmation .confirm-table {
	width: 100%;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	overflow: hidden;
	margin-bottom: 2rem;
}

.confirm-row {
	display: flex;
	border-bottom: 1px solid var(--border-color);
}

.confirm-row:last-child {
	border-bottom: none;
}

.confirm-label {
	width: 30%;
	padding: 1rem;
	background-color: #f8f9fa;
	font-weight: 500;
	border-right: 1px solid var(--border-color);
}

.confirm-value {
	width: 70%;
	padding: 1rem;
	word-break: break-word;
}

.confirm-multiline {
	white-space: pre-wrap;
}

/* Completion screen specific styles */
.completion {
	text-align: center;
}

.completion-header {
	margin-bottom: 2rem;
}

.completion-icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 1rem;
	background-color: var(--success-color);
	border-radius: 50%;
	position: relative;
}

.completion-icon:before,
.completion-icon:after {
	content: '';
	position: absolute;
	background-color: white;
}

.completion-icon:before {
	width: 10px;
	height: 30px;
	left: 40%;
	top: 45%;
	transform: translate(-50%, -50%) rotate(45deg);
}

.completion-icon:after {
	width: 30px;
	height: 10px;
	left: 60%;
	top: 55%;
	transform: translate(-50%, -50%) rotate(45deg);
}

.completion-title {
	color: var(--success-color);
	margin: 0;
	font-size: 2rem;
}

.completion-message {
	margin-bottom: 2rem;
	font-size: 1.1rem;
}

.completion-summary {
	margin-bottom: 2rem;
	text-align: left;
}

.completion-summary h3 {
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 0.5rem;
	margin-bottom: 1.5rem;
}

.summary-table {
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	overflow: hidden;
}

.summary-row {
	display: flex;
	border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child {
	border-bottom: none;
}

.summary-label {
	width: 30%;
	padding: 1rem;
	background-color: #f8f9fa;
	font-weight: 500;
	border-right: 1px solid var(--border-color);
}

.summary-value {
	width: 70%;
	padding: 1rem;
	word-break: break-word;
}

.summary-multiline {
	white-space: pre-wrap;
}

.completion-footer {
	margin-top: 2rem;
}

.back-to-home {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	background-color: var(--primary-color);
	color: white;
	text-decoration: none;
	border-radius: var(--border-radius);
	transition: var(--transition);
}

.back-to-home:hover {
	background-color: #3a7bc8;
	text-decoration: none;
	color: white;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
	.form-container {
		padding: 1.5rem;
		margin: 1rem;
	}

	/* Keep radio/checkbox groups horizontal on mobile as well */
	.radio-group,
	.checkbox-group {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.radio-inline,
	.checkbox-inline {
		margin-bottom: 0.5rem;
		width: auto; /* Allow items to take their natural width */
	}

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

	.back-button,
	.submit-button {
		width: 100%;
	}

	.back-button button,
	.submit-button button {
		width: 100%;
	}

	.confirm-row,
	.summary-row {
		flex-direction: column;
	}

	.confirm-label,
	.confirm-value,
	.summary-label,
	.summary-value {
		width: 100%;
		border-right: none;
	}

	.confirm-label,
	.summary-label {
		border-bottom: 1px solid var(--border-color);
	}
}

/* Print-friendly styles */
@media print {
	body {
		background-color: white;
	}

	.form-container {
		box-shadow: none;
		margin: 0;
		padding: 0;
	}

	.completion-footer,
	.form-buttons {
		display: none;
	}
}