/**
 * ICF Assessment Builder — Public Styles
 *
 * Themed to match ceresca.org design (dark teal, white cards, Open Sans).
 *
 * @package ICF_Assessment_Builder
 * @since   1.1.0
 */

/* ==================================================================
 * Container
 * ================================================================== */

.iab-assessment {
	max-width: 780px;
	margin: 2rem auto;
	padding: 2rem;
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 15px;
	line-height: 1.7;
	color: #333;
	position: relative;
}

/* Fade transition */
.iab-assessment.iab-transitioning {
	opacity: 0;
	transition: opacity 0.15s ease-out;
}

/* ==================================================================
 * Logos
 * ================================================================== */

.iab-logos {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
	padding: 1rem 0;
}

.iab-logos img {
	max-height: 80px;
	width: auto;
	max-width: 280px;
	object-fit: contain;
}

/* Large sponsor logo at the bottom of result screens */
.iab-sponsor-logo {
	display: block;
	margin: 2rem auto 0;
	text-align: center;
}

.iab-sponsor-logo img {
	max-width: 400px;
	width: 100%;
	height: auto;
}

/* ==================================================================
 * Progress bar
 * ================================================================== */

.iab-progress {
	position: relative;
	height: 6px;
	background: #d4e4e8;
	border-radius: 3px;
	margin-bottom: 1.5rem;
	overflow: hidden;
}

.iab-progress-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: #1b3a4b;
	border-radius: 3px;
	transition: width 0.3s ease;
}

.iab-progress-text {
	display: block;
	text-align: right;
	font-size: 0.75rem;
	color: #777;
	margin-top: 0.35rem;
}

/* ==================================================================
 * Screen title
 * ================================================================== */

.iab-screen-title {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0 0 1rem;
	line-height: 1.3;
	color: #1b3a4b;
}

/* ==================================================================
 * Screen content (HTML from server)
 * ================================================================== */

.iab-screen-content {
	margin-bottom: 1.5rem;
	line-height: 1.7;
}

.iab-screen-content p {
	margin: 0 0 1rem;
}

.iab-screen-content ul,
.iab-screen-content ol {
	margin: 0 0 1rem 1.5rem;
}

/* ==================================================================
 * Media
 * ================================================================== */

.iab-media {
	margin: 1rem 0;
}

.iab-media-image img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

/* YouTube 16:9 responsive wrapper */
.iab-youtube-wrapper {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: 8px;
}

.iab-youtube-wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.iab-media-video video {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

/* ==================================================================
 * Questions
 * ================================================================== */

.iab-question-form {
	margin: 0;
}

.iab-question {
	background: #ffffff;
	border: 1px solid #d4e4e8;
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
	transition: border-color 0.2s ease;
}

.iab-question.iab-error {
	border-color: #c0392b;
	background: #fdf0ef;
}

.iab-question-text {
	display: block;
	font-weight: 700;
	font-size: 1.05rem;
	margin-bottom: 0.75rem;
	color: #1b3a4b;
	cursor: default;
}

.iab-required {
	color: #c0392b;
	font-weight: 700;
}

/* ==================================================================
 * Help text (collapsible)
 * ================================================================== */

.iab-help-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	font-size: 0.8rem;
	font-weight: 700;
	color: #1b3a4b;
	background: #d4e4e8;
	border: 1px solid #1b3a4b;
	border-radius: 50%;
	cursor: pointer;
	margin-left: 0.5rem;
	vertical-align: middle;
	padding: 0;
	line-height: 1;
}

.iab-help-toggle:hover,
.iab-help-toggle:focus {
	background: #1b3a4b;
	color: #fff;
	outline: none;
}

.iab-help-text {
	display: none;
	background: #eef4f6;
	border-left: 3px solid #1b3a4b;
	padding: 0.75rem 1rem;
	margin: 0.75rem 0;
	border-radius: 0 6px 6px 0;
	font-size: 0.9rem;
	color: #555;
	line-height: 1.5;
}

.iab-help-text.iab-visible {
	display: block;
}

/* ==================================================================
 * Answer options
 * ================================================================== */

.iab-answer-option {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.65rem 0.9rem;
	margin-bottom: 0.4rem;
	border: 1px solid #d4e4e8;
	border-radius: 8px;
	cursor: pointer;
	background: #fff;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.iab-answer-option:hover {
	background: #eef4f6;
	border-color: #a0c4cc;
}

.iab-answer-option.iab-selected {
	background: #d4e4e8;
	border-color: #1b3a4b;
}

.iab-answer-option input[type="radio"],
.iab-answer-option input[type="checkbox"] {
	flex-shrink: 0;
	margin: 0;
	width: 16px;
	height: 16px;
	accent-color: #1b3a4b;
}

.iab-answer-text {
	font-size: 0.95rem;
}

/* "Other" free-text input */
.iab-other-input-wrap {
	padding: 0.5rem 0 0.5rem 2.2rem;
}

.iab-other-text {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid #d4e4e8;
	border-radius: 6px;
	font-size: 0.93rem;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s ease;
}

.iab-other-text:focus {
	border-color: #1b3a4b;
	box-shadow: 0 0 0 2px rgba(27, 58, 75, 0.12);
}

/* ==================================================================
 * Action buttons
 * ================================================================== */

.iab-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 1.5rem;
}

.iab-btn {
	display: inline-block;
	padding: 0.7rem 2rem;
	font-size: 1rem;
	font-weight: 600;
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
	text-decoration: none;
	line-height: 1.4;
	font-family: inherit;
}

.iab-btn:active {
	transform: scale(0.97);
}

.iab-btn:focus-visible {
	outline: 2px solid #1b3a4b;
	outline-offset: 2px;
}

/* Continue / Next — dark teal */
.iab-btn-continue,
.iab-btn-next {
	background: #1b3a4b;
	color: #fff;
	border-color: #1b3a4b;
}

.iab-btn-continue:hover,
.iab-btn-next:hover {
	background: #15303e;
	border-color: #15303e;
}

/* Back — outlined teal */
.iab-btn-back {
	background: transparent;
	color: #1b3a4b;
	border-color: #1b3a4b;
}

.iab-btn-back:hover {
	background: #eef4f6;
}

/* Restart — dark teal */
.iab-btn-restart {
	background: #1b3a4b;
	color: #fff;
	border-color: #1b3a4b;
}

.iab-btn-restart:hover {
	background: #15303e;
	border-color: #15303e;
}

/* ==================================================================
 * Loading spinner
 * ================================================================== */

.iab-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 0;
}

.iab-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #d4e4e8;
	border-top-color: #1b3a4b;
	border-radius: 50%;
	animation: iab-spin 0.7s linear infinite;
}

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

/* ==================================================================
 * Error message
 * ================================================================== */

.iab-error-message {
	text-align: center;
	padding: 2rem 1rem;
	color: #c0392b;
}

.iab-error-message p {
	margin: 0 0 1rem;
	font-size: 1rem;
}

/* ==================================================================
 * Contact form (result screens)
 * ================================================================== */

.iab-contact-form {
	margin-top: 2rem;
	padding: 1.5rem;
	background: #ffffff;
	border: 1px solid #d4e4e8;
	border-radius: 10px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.iab-contact-form h3 {
	margin: 0 0 1rem;
	font-size: 1.2rem;
	font-weight: 700;
	color: #1b3a4b;
}

.iab-contact-field {
	margin-bottom: 1rem;
}

.iab-contact-field label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 0.3rem;
	color: #1b3a4b;
}

.iab-contact-field input[type="text"],
.iab-contact-field input[type="email"],
.iab-contact-field input[type="tel"],
.iab-contact-field textarea {
	width: 100%;
	padding: 0.6rem 0.8rem;
	border: 1px solid #bbb;
	border-radius: 6px;
	font-size: 0.95rem;
	font-family: inherit;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.iab-contact-field input:focus,
.iab-contact-field textarea:focus {
	border-color: #1b3a4b;
	outline: 2px solid rgba(27, 58, 75, 0.2);
	outline-offset: 0;
}

.iab-contact-field textarea {
	min-height: 80px;
	resize: vertical;
}

.iab-contact-field.iab-field-error input,
.iab-contact-field.iab-field-error textarea {
	border-color: #c0392b;
}

.iab-contact-field .iab-field-error-msg {
	color: #c0392b;
	font-size: 0.8rem;
	margin-top: 0.25rem;
}

.iab-contact-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.4;
}

.iab-contact-checkbox input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 0.2rem;
	width: 16px;
	height: 16px;
	accent-color: #1b3a4b;
}

.iab-contact-checkbox.iab-field-error label {
	color: #c0392b;
}

.iab-contact-submit {
	display: inline-block;
	padding: 0.7rem 2rem;
	font-size: 1rem;
	font-weight: 600;
	border: 2px solid #1b3a4b;
	border-radius: 6px;
	cursor: pointer;
	background: #1b3a4b;
	color: #fff;
	font-family: inherit;
	transition: background-color 0.2s ease;
	margin-top: 0.5rem;
}

.iab-contact-submit:hover {
	background: #15303e;
}

.iab-contact-submit:disabled {
	background: #aaa;
	border-color: #aaa;
	cursor: not-allowed;
}

.iab-contact-success {
	padding: 1rem;
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
	border-radius: 6px;
	margin-top: 1rem;
	font-size: 0.95rem;
}

.iab-contact-error-msg {
	padding: 1rem;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
	border-radius: 6px;
	margin-top: 1rem;
	font-size: 0.95rem;
}

/* ==================================================================
 * Mobile responsive (max-width: 600px)
 * ================================================================== */

@media (max-width: 600px) {
	.iab-assessment {
		padding: 1rem;
		margin: 1rem auto;
	}

	.iab-screen-title {
		font-size: 1.3rem;
	}

	.iab-question {
		padding: 1rem;
	}

	.iab-question-text {
		font-size: 1rem;
	}

	.iab-answer-option {
		padding: 0.55rem 0.7rem;
	}

	.iab-answer-text {
		font-size: 0.9rem;
	}

	.iab-btn {
		padding: 0.6rem 1.5rem;
		font-size: 0.95rem;
		width: 100%;
	}

	.iab-actions {
		margin-top: 1.25rem;
		flex-wrap: wrap;
	}

	.iab-logos {
		gap: 1rem;
	}

	.iab-logos img {
		max-height: 40px;
	}

	.iab-contact-form {
		padding: 1rem;
	}

	.iab-contact-submit {
		width: 100%;
	}

	.iab-sponsor-logo img {
		max-width: 280px;
	}
}
