/* IHRO Membership Application — front-end styling */

:root {
	--ihro-primary: #0b5b57;
	--ihro-primary-dark: #083f3c;
	--ihro-accent: #c99a3c;
	--ihro-border: #dfe3e2;
	--ihro-bg-soft: #f6f8f7;
	--ihro-text: #1f2a29;
	--ihro-error: #b3261e;
	--ihro-success: #1e6b3c;
}

/* ---------- Form ---------- */

.ihro-form-wrap {
	max-width: 860px;
	margin: 0 auto;
	color: var(--ihro-text);
}

.ihro-membership-form .ihro-fieldset {
	border: 1px solid var(--ihro-border);
	border-radius: 10px;
	padding: 22px 24px 10px;
	margin-bottom: 24px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Step form: only the active step is shown */
.ihro-step-form .ihro-fieldset.ihro-step {
	display: none;
	margin-bottom: 0;
	border: none;
	box-shadow: none;
	padding: 4px 2px 10px;
	animation: ihroStepIn 0.25s ease;
}

.ihro-step-form .ihro-fieldset.ihro-step.is-active {
	display: block;
}

@keyframes ihroStepIn {
	from { opacity: 0; transform: translateX(12px); }
	to { opacity: 1; transform: translateX(0); }
}

/* Stepper progress indicator */
.ihro-stepper {
	display: flex;
	align-items: center;
	margin-bottom: 30px;
	overflow-x: auto;
	padding-bottom: 6px;
}

.ihro-stepper-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: none;
	min-width: 78px;
	text-align: center;
}

.ihro-stepper-circle {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #eef1f0;
	color: #8a9490;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.9rem;
	border: 2px solid #eef1f0;
	transition: all 0.2s ease;
}

.ihro-stepper-label {
	font-size: 0.72rem;
	color: #8a9490;
	margin-top: 6px;
	font-weight: 600;
	max-width: 90px;
	line-height: 1.25;
}

.ihro-stepper-item.is-active .ihro-stepper-circle {
	background: var(--ihro-step-color, var(--ihro-primary));
	border-color: var(--ihro-step-color, var(--ihro-primary));
	color: #fff;
	box-shadow: 0 0 0 4px rgba(11, 91, 87, 0.15);
}

.ihro-stepper-item.is-active .ihro-stepper-label {
	color: var(--ihro-step-color, var(--ihro-primary-dark));
}

.ihro-stepper-item.is-complete .ihro-stepper-circle {
	background: var(--ihro-success);
	border-color: var(--ihro-success);
	color: #fff;
}

.ihro-stepper-line {
	flex: 1;
	height: 2px;
	background: #eef1f0;
	min-width: 20px;
	margin: 0 4px 20px;
	transition: background 0.2s ease;
}

.ihro-stepper-line.is-complete {
	background: var(--ihro-success);
}

.ihro-step-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 26px 0 10px;
	flex-wrap: wrap;
}

.ihro-step-status {
	font-size: 0.85rem;
	color: #8a9490;
	font-weight: 600;
	order: 3;
	width: 100%;
	text-align: center;
}

.ihro-btn-prev,
.ihro-btn-next {
	background: #fff;
	border: 1px solid var(--ihro-border);
	color: var(--ihro-btn-bg, var(--ihro-primary-dark));
	padding: 12px 26px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	font-size: var(--ihro-btn-font-size, 0.95rem);
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ihro-btn-next {
	background: var(--ihro-btn-bg, var(--ihro-primary));
	border-color: var(--ihro-btn-bg, var(--ihro-primary));
	color: var(--ihro-btn-text, #fff);
	margin-left: auto;
}

.ihro-btn-next:hover {
	filter: brightness(0.9);
}

.ihro-btn-prev:hover {
	background: var(--ihro-bg-soft);
}

@media (min-width: 601px) {
	.ihro-step-status {
		order: 0;
		width: auto;
	}
}

.ihro-membership-form legend {
	font-weight: 700;
	font-size: 1.08rem;
	color: var(--ihro-primary-dark);
	padding: 0 8px;
}

.ihro-membership-form .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ihro-declaration-text {
	background: var(--ihro-bg-soft);
	border-left: 3px solid var(--ihro-accent);
	padding: 12px 16px;
	margin-bottom: 16px;
	font-size: 0.92rem;
}

.ihro-declaration-text ol {
	margin: 8px 0 0 20px;
}

.ihro-field-row {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -10px;
}

.ihro-field {
	margin-bottom: 18px;
	padding: 0 10px;
	box-sizing: border-box;
	width: 100%;
}

.ihro-w-100 { width: 100%; }
.ihro-w-66  { width: 66.66%; }
.ihro-w-50  { width: 50%; }
.ihro-w-33  { width: 33.33%; }
.ihro-w-25  { width: 25%; }

.ihro-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 0.94rem;
}

.ihro-required {
	color: var(--ihro-error);
	margin-left: 2px;
}

.ihro-field input[type="text"],
.ihro-field input[type="email"],
.ihro-field input[type="date"],
.ihro-field select,
.ihro-field textarea {
	width: 100%;
	padding: 10px 13px;
	border: 1px solid var(--ihro-border);
	border-radius: 8px;
	font-size: 0.95rem;
	box-sizing: border-box;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ihro-field input:focus,
.ihro-field select:focus,
.ihro-field textarea:focus {
	outline: none;
	border-color: var(--ihro-primary);
	box-shadow: 0 0 0 3px rgba(11, 91, 87, 0.12);
}

.ihro-radio-group,
.ihro-checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}

.ihro-radio-label,
.ihro-checkbox-label {
	font-weight: 400 !important;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Step 3 (Membership Information) and Step 4 (Attached Documents):
   radio/checkbox options stacked vertically instead of side by side. */
.ihro-fieldset[data-step="3"] .ihro-radio-group,
.ihro-fieldset[data-step="4"] .ihro-radio-group,
.ihro-fieldset[data-step="3"] .ihro-checkbox-group,
.ihro-fieldset[data-step="4"] .ihro-checkbox-group {
	flex-direction: column;
	gap: 10px;
}

/* Image upload */

.ihro-image-upload {
	position: relative;
}

.ihro-image-upload input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ihro-image-drop {
	display: flex;
	align-items: center;
	gap: 14px;
	border: 1.5px dashed var(--ihro-border);
	border-radius: 10px;
	padding: 14px 18px;
	cursor: pointer;
	background: var(--ihro-bg-soft);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.ihro-image-drop:hover {
	border-color: var(--ihro-primary);
	background: #eef5f4;
}

.ihro-image-drop-preview {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--ihro-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	overflow: hidden;
	flex: none;
}

.ihro-image-drop-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ihro-image-drop-text {
	font-weight: 600;
	color: var(--ihro-primary-dark);
	font-size: 0.92rem;
}

.ihro-submit-row {
	text-align: center;
	margin: 28px 0;
}

.ihro-submit-btn {
	background: var(--ihro-btn-bg, var(--ihro-primary));
	color: var(--ihro-btn-text, #fff);
	border: none;
	padding: 13px 36px;
	font-size: var(--ihro-btn-font-size, 1rem);
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.ihro-step-nav .ihro-submit-btn {
	padding: 12px 30px;
	margin-left: auto;
}

.ihro-submit-btn:hover {
	filter: brightness(0.9);
}

.ihro-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.ihro-notice {
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 20px;
	font-size: 0.95rem;
}

.ihro-notice-error {
	background: #fbecec;
	border: 1px solid var(--ihro-error);
	color: var(--ihro-error);
}

.ihro-notice-error ul {
	margin: 8px 0 0 20px;
}

.ihro-notice-success {
	background: #eaf6ee;
	border: 1px solid var(--ihro-success);
	color: var(--ihro-success);
}

/* ---------- ID Search ---------- */

.ihro-search-wrap {
	max-width: 560px;
	margin: 0 auto;
	width: 100%;
}

.ihro-search-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.ihro-search-row {
	display: flex;
	gap: 8px;
}

.ihro-search-row input[type="text"] {
	flex: 1;
	padding: 11px 14px;
	border: 1px solid var(--ihro-border);
	border-radius: 8px;
	font-size: 0.95rem;
	min-width: 0;
}

.ihro-search-row button {
	background: var(--ihro-primary);
	color: #fff;
	border: none;
	padding: 11px 22px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.ihro-search-row button:hover {
	background: var(--ihro-primary-dark);
}

.ihro-result-card {
	margin-top: 20px;
	border: 1px solid var(--ihro-border);
	border-radius: 10px;
	overflow: hidden;
	width: 100%;
}

.ihro-result-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.ihro-result-table th,
.ihro-result-table td {
	text-align: left;
	padding: 12px 18px;
	border-bottom: 1px solid var(--ihro-border);
	font-size: 0.94rem;
	word-break: break-word;
}

.ihro-result-table th {
	width: 40%;
	background: var(--ihro-bg-soft);
	font-weight: 600;
}

.ihro-result-table tr:last-child th,
.ihro-result-table tr:last-child td {
	border-bottom: none;
}

/* Badges (shared with admin) */

.ihro-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.78rem;
	font-weight: 600;
}

.ihro-badge-pending { background: #fff3cd; color: #7a5b00; }
.ihro-badge-approved { background: #e2f6e9; color: #1e6b3c; }
.ihro-badge-not-approved { background: #fbecec; color: #b3261e; }

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
	.ihro-w-66, .ihro-w-50, .ihro-w-33, .ihro-w-25 {
		width: 100%;
	}
	.ihro-membership-form .ihro-fieldset {
		padding: 16px;
	}
	.ihro-search-row {
		flex-direction: column;
	}
	.ihro-result-table th {
		width: 50%;
	}
}

/* ---------- Success popup ---------- */

.ihro-success-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 22, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.ihro-success-overlay.is-open {
	opacity: 1;
}

.ihro-success-modal {
	position: relative;
	background: #fff;
	border-radius: 18px;
	padding: 40px 36px 34px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	transform: translateY(14px) scale(0.97);
	transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.ihro-success-overlay.is-open .ihro-success-modal {
	transform: translateY(0) scale(1);
}

.ihro-success-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	color: #a7b3b1;
	cursor: pointer;
	padding: 4px;
}

.ihro-success-close:hover {
	color: var(--ihro-text);
}

.ihro-success-icon {
	width: 74px;
	height: 74px;
	border-radius: 50%;
	background: var(--ihro-primary);
	color: #fff;
	font-size: 2.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 18px;
	animation: ihroPopIn 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) 0.1s both;
}

@keyframes ihroPopIn {
	from { transform: scale(0.4); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

.ihro-success-modal h2 {
	margin: 0 0 10px;
	font-size: 1.3rem;
	color: var(--ihro-text);
}

.ihro-success-modal p {
	margin: 0 0 26px;
	color: #5b6664;
	font-size: 0.95rem;
	line-height: 1.55;
}

.ihro-success-btn {
	background: var(--ihro-primary);
	color: #fff;
	border: none;
	padding: 12px 34px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.ihro-success-btn:hover {
	filter: brightness(0.9);
}

@media (prefers-reduced-motion: reduce) {
	.ihro-success-icon,
	.ihro-success-modal {
		animation: none;
		transition: none;
	}
}

/* ---------- Blood Bank ---------- */

.ihro-bloodbank-wrap {
	max-width: 100%;
}

.ihro-bloodbank-form {
	max-width: 480px;
	margin: 0 auto 24px;
}

.ihro-bloodbank-select {
	flex: 1;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--ihro-border);
	border-radius: 8px;
	font-size: 0.95rem;
	background: #fff;
	color: var(--ihro-text);
}

.ihro-bloodbank-count {
	font-size: 0.88rem;
	color: #6c7876;
	margin-bottom: 14px;
	font-weight: 600;
}

.ihro-bloodbank-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 18px;
}

.ihro-bloodbank-card {
	background: #fff;
	border: 1px solid var(--ihro-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(15, 23, 22, 0.05);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: flex;
	flex-direction: column;
}

.ihro-bloodbank-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 22px rgba(15, 23, 22, 0.1);
}

.ihro-bloodbank-photo {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: var(--ihro-bg-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ihro-bloodbank-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ihro-bloodbank-photo-placeholder {
	font-size: 2.6rem;
	opacity: 0.35;
}

.ihro-bloodbank-body {
	padding: 16px 16px 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ihro-bloodbank-name {
	margin: 0 0 2px;
	font-size: 1.05rem;
	color: var(--ihro-text);
}

.ihro-bloodbank-blood-badge {
	align-self: flex-start;
	background: #fbeaea;
	color: #b3261e;
	font-weight: 700;
	font-size: 0.85rem;
	padding: 3px 12px;
	border-radius: 20px;
	margin-bottom: 6px;
}

.ihro-bloodbank-row {
	font-size: 0.88rem;
	color: #495652;
	line-height: 1.5;
}

.ihro-bloodbank-row-label {
	color: #8a9490;
	font-weight: 600;
}

@media (max-width: 480px) {
	.ihro-bloodbank-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 12px;
	}
	.ihro-bloodbank-body {
		padding: 12px;
	}
}
