/*
 * Exam Copy Request – frontend styles.
 *
 * BEM-flavoured, scoped under .ec-wrap / #ec-wrap to avoid collisions
 * with the rest of the theme.
 *
 * Phase 2:  Step indicator, search bar, result list, selected books list.
 * Phase 3+: Form fields, course info blocks, validation states (appended below).
 *
 * @package HCP_Christian
 */

/* ============================================================
   CSS custom properties (easy override per brand)
   ============================================================ */
:root {
	--ec-color-primary:       #1a4f8a;
	--ec-color-primary-dark:  #0f3464;
	--ec-color-primary-light: #e8f0fb;
	--ec-color-accent:        #c8873a;
	--ec-color-success:       #2d7a4f;
	--ec-color-error:         #c0392b;
	--ec-color-text:          #1c1c1e;
	--ec-color-text-muted:    #5f6368;
	--ec-color-border:        #d1d5db;
	--ec-color-bg:            #ffffff;
	--ec-color-bg-soft:       #f8f9fa;
	--ec-radius:              6px;
	--ec-shadow-sm:           0 1px 3px rgba(0,0,0,.10);
	--ec-shadow-md:           0 4px 12px rgba(0,0,0,.12);
	--ec-font-body:           inherit;
	--ec-transition:          200ms ease;
}

/* ============================================================
   Wrap
   ============================================================ */
.ec-wrap {
	font-family: var(--ec-font-body);
	color: var(--ec-color-text);
	max-width: 900px;
	margin: 0 auto;
	padding: 0 16px 60px;
}

/* ============================================================
   Step indicator
   ============================================================ */
.ec-steps {
	margin-bottom: 40px;
}

.ec-steps__list {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-steps__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.ec-steps__bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--ec-color-border);
	color: var(--ec-color-text-muted);
	font-size: 15px;
	font-weight: 700;
	transition: background var(--ec-transition), color var(--ec-transition);
}

.ec-steps__label {
	font-size: 12px;
	font-weight: 500;
	color: var(--ec-color-text-muted);
	white-space: nowrap;
	transition: color var(--ec-transition);
}

/* Active step */
.ec-steps__item--active .ec-steps__bubble {
	background: var(--ec-color-primary);
	color: #fff;
}
.ec-steps__item--active .ec-steps__label {
	color: var(--ec-color-primary);
	font-weight: 700;
}

/* Completed step */
.ec-steps__item--complete .ec-steps__bubble {
	background: var(--ec-color-success);
	color: #fff;
}
.ec-steps__item--complete .ec-steps__bubble::before {
	content: '✓';
}
.ec-steps__item--complete .ec-steps__label {
	color: var(--ec-color-success);
}

/* Connector line */
.ec-steps__connector {
	flex: 1;
	height: 2px;
	background: var(--ec-color-border);
	margin: 0 12px;
	margin-bottom: 22px; /* align with bubble centre */
}

/* ============================================================
   Sections
   ============================================================ */
.ec-section {
	background: var(--ec-color-bg);
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
	padding: 28px 32px;
	margin-bottom: 24px;
	box-shadow: var(--ec-shadow-sm);
}

.ec-section__header {
	margin-bottom: 20px;
}
.ec-section__header--flex {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
}

.ec-section__title {
	font-size: 20px;
	font-weight: 700;
	color: var(--ec-color-text);
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ec-section__desc {
	font-size: 14px;
	color: var(--ec-color-text-muted);
	margin: 0;
}

/* ============================================================
   Search bar
   ============================================================ */
.ec-search-bar {
	margin-bottom: 16px;
}

.ec-search-bar__inner {
	position: relative;
	display: flex;
	align-items: center;
}

.ec-search-bar__icon {
	position: absolute;
	left: 14px;
	color: var(--ec-color-text-muted);
	pointer-events: none;
	flex-shrink: 0;
}

.ec-search-bar__input {
	width: 100%;
	padding: 12px 44px 12px 44px;
	font-size: 15px;
	border: 2px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
	outline: none;
	background: var(--ec-color-bg);
	color: var(--ec-color-text);
	transition: border-color var(--ec-transition), box-shadow var(--ec-transition);
	box-sizing: border-box;
}

.ec-search-bar__input:focus {
	border-color: var(--ec-color-primary);
	box-shadow: 0 0 0 3px rgba(26, 79, 138, .15);
}

.ec-search-bar__input::placeholder {
	color: var(--ec-color-text-muted);
}

/* Spinner (right side of input) */
.ec-search-bar__spinner {
	position: absolute;
	right: 14px;
	width: 18px;
	height: 18px;
	border: 2px solid var(--ec-color-border);
	border-top-color: var(--ec-color-primary);
	border-radius: 50%;
	display: none;
}

.ec-search-bar__spinner.is-active {
	display: block;
	animation: ec-spin 0.7s linear infinite;
}

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

.ec-search-bar__hint {
	font-size: 12px;
	color: var(--ec-color-text-muted);
	margin: 6px 0 0;
}

/* ============================================================
   Search results
   ============================================================ */
.ec-search-results {
	min-height: 0;
}

.ec-search-results.is-loading::after {
	content: '';
	display: block;
	height: 4px;
	background: linear-gradient(90deg, var(--ec-color-primary) 0%, transparent 100%);
	border-radius: 2px;
	animation: ec-progress 1.2s ease-in-out infinite;
}

@keyframes ec-progress {
	0%   { width: 0;    margin-left: 0; }
	50%  { width: 60%;  margin-left: 20%; }
	100% { width: 0;    margin-left: 100%; }
}

.ec-results-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
	overflow: hidden;
}

.ec-result-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--ec-color-border);
	background: var(--ec-color-bg);
	transition: background var(--ec-transition);
}

.ec-result-item:last-child {
	border-bottom: none;
}

.ec-result-item:hover {
	background: var(--ec-color-bg-soft);
}

/* Image */
.ec-result__image {
	flex-shrink: 0;
	width: 48px;
	height: 64px;
	overflow: hidden;
	border-radius: 4px;
	background: var(--ec-color-bg-soft);
	border: 1px solid var(--ec-color-border);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ec-result__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ec-result__image--empty::after {
	content: '📖';
	font-size: 22px;
}

/* Info */
.ec-result__info {
	flex: 1;
	min-width: 0;
}

.ec-result__info p {
	margin: 0 0 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ec-result__title {
	font-size: 15px;
	font-weight: 600;
	color: var(--ec-color-text);
}

.ec-result__author {
	font-size: 13px;
	color: var(--ec-color-text-muted);
}

.ec-result__isbn {
	font-size: 12px;
	color: var(--ec-color-text-muted);
	font-family: monospace;
}

/* Action */
.ec-result__action {
	flex-shrink: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.ec-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	border: 2px solid transparent;
	border-radius: var(--ec-radius);
	cursor: pointer;
	text-decoration: none;
	transition: background var(--ec-transition), color var(--ec-transition),
	            border-color var(--ec-transition), box-shadow var(--ec-transition);
	white-space: nowrap;
}

.ec-btn:focus-visible {
	outline: 3px solid var(--ec-color-primary);
	outline-offset: 2px;
}

/* Primary */
.ec-btn--primary {
	background: var(--ec-color-primary);
	color: #fff;
	border-color: var(--ec-color-primary);
}

.ec-btn--primary:hover:not(:disabled) {
	background: var(--ec-color-primary-dark);
	border-color: var(--ec-color-primary-dark);
}

.ec-btn--primary:disabled {
	opacity: .45;
	cursor: not-allowed;
}

/* Ghost (back button) */
.ec-btn--ghost {
	background: transparent;
	color: var(--ec-color-primary);
	border-color: var(--ec-color-primary);
}

.ec-btn--ghost:hover {
	background: var(--ec-color-primary-light);
}

/* Add book */
.ec-btn--add {
	background: var(--ec-color-primary-light);
	color: var(--ec-color-primary);
	border-color: var(--ec-color-primary-light);
	padding: 7px 14px;
	font-size: 13px;
}

.ec-btn--add:hover:not(:disabled) {
	background: var(--ec-color-primary);
	color: #fff;
	border-color: var(--ec-color-primary);
}

.ec-btn--add.is-added,
.ec-btn--add:disabled {
	background: #e8f5ee;
	color: var(--ec-color-success);
	border-color: #c3e6d1;
	cursor: default;
}

/* Remove (×) */
.ec-btn-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: #fee2e2;
	color: var(--ec-color-error);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	transition: background var(--ec-transition);
}

.ec-btn-remove:hover {
	background: var(--ec-color-error);
	color: #fff;
}

/* ============================================================
   Badge
   ============================================================ */
.ec-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	font-size: 12px;
	font-weight: 700;
	background: var(--ec-color-primary);
	color: #fff;
	border-radius: 99px;
}

/* ============================================================
   Selected books list
   ============================================================ */
.ec-selected-list {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ec-selected-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	background: var(--ec-color-bg-soft);
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
}

.ec-selected-item__thumb {
	width: 40px;
	height: 54px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
	border: 1px solid var(--ec-color-border);
}

.ec-selected-item__info {
	flex: 1;
	min-width: 0;
}

.ec-selected-item__info p {
	margin: 0 0 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ec-selected-item__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--ec-color-text);
}

.ec-selected-item__author {
	font-size: 13px;
	color: var(--ec-color-text-muted);
}

.ec-selected-item__isbn {
	font-size: 12px;
	color: var(--ec-color-text-muted);
	font-family: monospace;
}

/* ============================================================
   Step actions
   ============================================================ */
.ec-step-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 20px;
}

.ec-step-back {
	margin-bottom: 24px;
}

/* ============================================================
   Messages
   ============================================================ */
.ec-message {
	padding: 12px 16px;
	border-radius: var(--ec-radius);
	font-size: 14px;
	margin: 12px 0 0;
}

.ec-message--empty {
	background: var(--ec-color-bg-soft);
	color: var(--ec-color-text-muted);
	border: 1px dashed var(--ec-color-border);
}

.ec-message--error {
	background: #fef2f2;
	color: var(--ec-color-error);
	border: 1px solid #fecaca;
}

.ec-empty-msg {
	font-size: 14px;
	color: var(--ec-color-text-muted);
	margin: 0;
	padding: 16px;
	text-align: center;
	border: 1px dashed var(--ec-color-border);
	border-radius: var(--ec-radius);
}

/* ============================================================
   Step 2 – book summary (with inline remove)
   ============================================================ */

/* Step 2 remove button — same visual style as ec-btn-remove */
.ec-step2-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: none;
	background: #fee2e2;
	color: var(--ec-color-error);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	margin-left: auto;
	transition: background var(--ec-transition);
}

.ec-step2-remove:hover {
	background: var(--ec-color-error);
	color: #fff;
}

/* ============================================================
   Step 2 – book summary
   ============================================================ */
.ec-step2-book-summary {
	background: var(--ec-color-primary-light);
	border: 1px solid #b8d0f0;
	border-radius: var(--ec-radius);
	padding: 16px 20px;
	margin-bottom: 24px;
}

.ec-step2-summary__heading {
	font-size: 14px;
	font-weight: 700;
	color: var(--ec-color-primary);
	margin: 0 0 12px;
}

.ec-step2-summary__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ec-step2-summary__item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
}

.ec-step2-summary__thumb {
	width: 32px;
	height: 44px;
	object-fit: cover;
	border-radius: 3px;
	flex-shrink: 0;
}

.ec-step2-summary__info {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px;
}

.ec-step2-summary__author {
	color: var(--ec-color-text-muted);
	font-size: 13px;
}

.ec-step2-summary__isbn {
	display: block;
	font-size: 11px;
	font-family: monospace;
	color: var(--ec-color-text-muted);
}

/* ============================================================
   Phase 3 – Form sections
   ============================================================ */

/* Section header */
.ec-form-section {
	background: var(--ec-color-bg);
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
	padding: 28px 32px;
	margin-bottom: 24px;
	box-shadow: var(--ec-shadow-sm);
}

.ec-form-section__header {
	margin-bottom: 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--ec-color-border);
}

.ec-form-section__header--flex {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
}

.ec-form-section__title {
	font-size: 17px;
	font-weight: 700;
	color: var(--ec-color-primary);
	margin: 0 0 4px;
}

.ec-form-section__desc {
	font-size: 13px;
	color: var(--ec-color-text-muted);
	margin: 0;
}

/* ============================================================
   Phase 3 – Form rows and groups
   ============================================================ */

.ec-form-row {
	margin-bottom: 16px;
}

.ec-form-row:last-child {
	margin-bottom: 0;
}

.ec-form-row--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.ec-form-row--3col {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 16px;
}

.ec-form-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.ec-form-group label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ec-color-text);
	display: flex;
	align-items: center;
	gap: 4px;
}

.ec-required {
	color: var(--ec-color-error);
	font-weight: 700;
}

.ec-optional {
	font-size: 11px;
	font-weight: 400;
	color: var(--ec-color-text-muted);
}

/* ============================================================
   Phase 3 – Form inputs
   ============================================================ */

.ec-form-input {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1.5px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
	background: var(--ec-color-bg);
	color: var(--ec-color-text);
	outline: none;
	box-sizing: border-box;
	transition: border-color var(--ec-transition), box-shadow var(--ec-transition);
	appearance: none;
	-webkit-appearance: none;
}

.ec-form-input:focus {
	border-color: var(--ec-color-primary);
	box-shadow: 0 0 0 3px rgba(26, 79, 138, .12);
}

.ec-form-input::placeholder {
	color: #adb5bd;
}

.ec-form-input:disabled {
	background: #f1f3f5;
	color: #adb5bd;
	cursor: not-allowed;
	border-color: #e9ecef;
}

/* Select arrow */
select.ec-form-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6368' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

.ec-form-textarea {
	resize: vertical;
	min-height: 80px;
}

/* Error state (applied by validation in Phase 4) */
.ec-form-input.ec-has-error {
	border-color: var(--ec-color-error);
	box-shadow: 0 0 0 3px rgba(192, 57, 43, .10);
}

.ec-field-error {
	font-size: 12px;
	color: var(--ec-color-error);
	margin: 3px 0 0;
	display: flex;
	align-items: center;
	gap: 4px;
}

/* ============================================================
   Phase 3 – Course blocks (with accordion)
   ============================================================ */

.ec-course-block {
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
	overflow: hidden;
	margin-bottom: 16px;
}

.ec-course-book-info {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: var(--ec-color-primary-light);
	border-bottom: 1px solid #b8d0f0;
	cursor: pointer;
	user-select: none;
	transition: background var(--ec-transition);
}

.ec-course-book-info:hover {
	background: #d8e8f8;
}

.ec-course-book-info:focus-visible {
	outline: 3px solid var(--ec-color-primary);
	outline-offset: -3px;
}

/* Chevron icon */
.ec-accordion-chevron {
	margin-left: auto;
	flex-shrink: 0;
	color: var(--ec-color-primary);
	transition: transform 250ms ease;
}

.ec-course-book-info.is-collapsed .ec-accordion-chevron {
	transform: rotate(-90deg);
}

/* "Different course info" checkbox row — sits between the accordion header
   and the collapsible body, always visible regardless of collapse state. */
.ec-same-as-book1-row {
	margin: 0;
	padding: 10px 16px;
	background: #fffbeb;
	border-top: 1px solid #fde68a;
	border-bottom: 1px solid #fde68a;
}

.ec-course-book-thumb {
	width: 36px;
	height: 50px;
	object-fit: cover;
	border-radius: 3px;
	flex-shrink: 0;
}

.ec-course-book-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ec-course-book-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--ec-color-primary);
	margin: 0;
}

.ec-course-book-author {
	font-size: 12px;
	color: var(--ec-color-text-muted);
	margin: 0;
}

.ec-course-book-isbn {
	font-size: 11px;
	font-family: monospace;
	color: var(--ec-color-text-muted);
	margin: 0;
}

.ec-course-fields {
	padding: 20px;
}

/* ============================================================
   Phase 3 – Toggle checkboxes
   ============================================================ */

.ec-same-course-row,
.ec-same-billing-row {
	margin-bottom: 20px;
	padding: 12px 16px;
	background: var(--ec-color-bg-soft);
	border: 1px solid var(--ec-color-border);
	border-radius: var(--ec-radius);
}

.ec-toggle-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: var(--ec-color-text);
	user-select: none;
}

.ec-toggle-checkbox {
	width: 16px;
	height: 16px;
	accent-color: var(--ec-color-primary);
	cursor: pointer;
	flex-shrink: 0;
}

/* ============================================================
   Phase 3 – Shipping sync state
   ============================================================ */

.ec-shipping-fields.is-synced {
	opacity: .6;
	pointer-events: none;
}

.ec-shipping-fields.is-synced .ec-form-input {
	background: #f1f3f5;
	color: #6c757d;
}

/* ============================================================
   Phase 3 – Radio groups
   ============================================================ */

.ec-form-group--radio {
	margin-bottom: 16px;
}

.ec-radio-legend {
	font-size: 13px;
	font-weight: 600;
	color: var(--ec-color-text);
	margin: 0 0 10px;
}

.ec-radio-group {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.ec-radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
}

.ec-radio-input {
	width: 16px;
	height: 16px;
	accent-color: var(--ec-color-primary);
	cursor: pointer;
}

/* ============================================================
   Phase 3 – Checkbox groups
   ============================================================ */

.ec-form-group--checkbox {
	margin-bottom: 14px;
}

.ec-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	cursor: pointer;
	line-height: 1.5;
}

.ec-checkbox-input {
	width: 16px;
	height: 16px;
	accent-color: var(--ec-color-primary);
	cursor: pointer;
	flex-shrink: 0;
	margin-top: 2px;
}

/* ============================================================
   Phase 3 – Checkbox stacks (catalog / disciplines / memberships)
   ============================================================ */

.ec-form-group--checkbox-group {
	margin-bottom: 20px;
}

.ec-checkbox-stack {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-left: 4px;
}

/* Requester synced state */
.ec-requester-fields.is-synced {
	opacity: .6;
	pointer-events: none;
}

/* ============================================================
   Phase 3 – Form submit area
   ============================================================ */

.ec-form-submit {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 24px 0 0;
	border-top: 1px solid var(--ec-color-border);
	margin-top: 8px;
}

.ec-required-note {
	font-size: 12px;
	color: var(--ec-color-text-muted);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 4px;
}

.ec-btn--lg {
	padding: 13px 28px;
	font-size: 15px;
}

/* Submit loading state */
.ec-btn--primary.is-loading {
	opacity: .75;
	pointer-events: none;
}

.ec-btn--primary.is-loading::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ec-spin .7s linear infinite;
	margin-left: 8px;
}

/* ============================================================
   Phase 4 – Validation states
   ============================================================ */

/* Field error message (injected by jQuery Validate) */
span.ec-field-error {
	display: block;
	font-size: 12px;
	color: var(--ec-color-error);
	margin-top: 4px;
	padding-left: 2px;
	animation: ec-fade-in 180ms ease;
}

@keyframes ec-fade-in {
	from { opacity: 0; transform: translateY(-3px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Field-level error border */
.ec-form-input.ec-has-error {
	border-color: var(--ec-color-error);
	box-shadow: 0 0 0 3px rgba(192, 57, 43, .10);
}

/* Field-level valid state */
.ec-form-input.ec-is-valid {
	border-color: var(--ec-color-success);
}

/* Form-group with error */
.ec-form-group.has-error > label {
	color: var(--ec-color-error);
}

/* Section-level error highlight */
.ec-form-section.has-section-error {
	border-color: #f5c6cb;
	box-shadow: 0 0 0 3px rgba(192, 57, 43, .07);
}

.ec-form-section.has-section-error .ec-form-section__title {
	color: var(--ec-color-error);
}

/* Course block with errors */
.ec-course-block.has-section-error {
	border-color: #f5c6cb;
}

.ec-course-block.has-section-error .ec-course-book-info {
	background: #fef2f2;
	border-bottom-color: #f5c6cb;
}

/* Step 1 error (no books selected) */
.ec-step1-error {
	margin-bottom: 12px;
	text-align: center;
}

/* ============================================================
   Phase 5 – Success confirmation state
   ============================================================ */

.ec-submit-success {
	text-align: center;
	padding: 48px 32px;
}

/* Animated SVG checkmark */
.ec-success-icon {
	margin-bottom: 24px;
	color: var(--ec-color-success);
	display: inline-block;
}

.ec-success-circle {
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
	animation: ec-circle-draw 0.6s ease forwards;
}

.ec-success-check {
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: ec-check-draw 0.4s 0.5s ease forwards;
}

@keyframes ec-circle-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes ec-check-draw {
	to { stroke-dashoffset: 0; }
}

.ec-success-title {
	font-size: 24px;
	font-weight: 700;
	color: var(--ec-color-success);
	margin: 0 0 20px;
}

/* Request number box */
.ec-success-ref-box {
	display: inline-block;
	background: var(--ec-color-bg-soft);
	border: 2px dashed var(--ec-color-success);
	border-radius: var(--ec-radius);
	padding: 16px 32px;
	margin-bottom: 20px;
}

.ec-success-ref-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ec-color-text-muted);
	margin: 0 0 6px;
}

.ec-success-ref-number {
	font-size: 28px;
	font-weight: 800;
	font-family: monospace;
	color: var(--ec-color-primary);
	margin: 0;
	letter-spacing: .05em;
}

.ec-success-note {
	font-size: 14px;
	color: var(--ec-color-text-muted);
	max-width: 480px;
	margin: 0 auto 24px;
	line-height: 1.6;
}

.ec-success-restart {
	margin: 0 auto;
}

/* General submit error (above submit button) */
.ec-submit-error {
	margin-bottom: 12px;
}

/* ============================================================
   Phase 3 – Responsive overrides
   ============================================================ */

@media ( max-width: 768px ) {
	.ec-form-row--2col,
	.ec-form-row--3col {
		grid-template-columns: 1fr;
	}

	.ec-form-section {
		padding: 20px 16px;
	}
}

@media ( max-width: 600px ) {
	.ec-form-submit {
		flex-direction: column;
		align-items: stretch;
	}

	.ec-btn--lg {
		width: 100%;
		justify-content: center;
	}

	.ec-radio-group {
		flex-direction: column;
		gap: 10px;
	}
}

/* ============================================================
   Responsive
   ============================================================ */
@media ( max-width: 600px ) {
	.ec-section {
		padding: 20px 16px;
	}

	.ec-result-item {
		flex-wrap: wrap;
	}

	.ec-result__action {
		width: 100%;
	}

	.ec-result__action .ec-btn--add {
		width: 100%;
		justify-content: center;
	}

	.ec-step-actions {
		justify-content: stretch;
	}

	.ec-btn--primary {
		width: 100%;
		justify-content: center;
	}

	.ec-steps__label {
		display: none;
	}
}
