/**
 * Stape Multi-step Wizard Stylesheet
 * 
 * Elegant, premium glassmorphism design system.
 */

:root {
	--stape-bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
	--stape-card-bg: rgba(30, 27, 75, 0.4);
	--stape-card-border: rgba(99, 102, 241, 0.2);
	--stape-primary: #6366f1;
	--stape-primary-glow: rgba(99, 102, 241, 0.4);
	--stape-secondary: #a855f7;
	--stape-accent: #10b981;
	--stape-danger: #ef4444;
	--stape-text-main: #f8fafc;
	--stape-text-muted: #94a3b8;
	--stape-input-bg: rgba(15, 23, 42, 0.6);
	--stape-input-border: rgba(148, 163, 184, 0.2);
}

.stape-wizard-container {
	font-family: 'Outfit', sans-serif;
	background: var(--stape-bg-gradient);
	border: 1px solid var(--stape-card-border);
	border-radius: 24px;
	padding: 40px;
	max-width: 680px;
	margin: 40px auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: var(--stape-text-main);
	box-sizing: border-box;
}

.stape-wizard-container * {
	box-sizing: border-box;
}

/* --- Wizard Header & Progress Bar --- */
.stape-wizard-header {
	margin-bottom: 40px;
}

.stape-progress-bar-container {
	position: relative;
	width: 100%;
	padding: 10px 0;
}

.stape-progress-line {
	position: absolute;
	top: 26px;
	left: 0;
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
	z-index: 1;
}

.stape-progress-fill {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, var(--stape-primary), var(--stape-secondary));
	border-radius: 2px;
	transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 0 10px var(--stape-primary-glow);
}

.stape-progress-steps {
	position: relative;
	display: flex;
	justify-content: space-between;
	z-index: 2;
}

.stape-step-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: default;
}

.stape-step-node .step-num {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #1e293b;
	border: 2px solid rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	color: var(--stape-text-muted);
	transition: all 0.4s ease;
}

.stape-step-node .step-label {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--stape-text-muted);
	transition: all 0.4s ease;
}

.stape-step-node.active .step-num {
	background: var(--stape-primary);
	border-color: var(--stape-primary);
	color: #fff;
	box-shadow: 0 0 15px var(--stape-primary-glow);
	transform: scale(1.1);
}

.stape-step-node.active .step-label {
	color: var(--stape-text-main);
	font-weight: 600;
}

.stape-step-node.completed .step-num {
	background: var(--stape-accent);
	border-color: var(--stape-accent);
	color: #fff;
	box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.stape-step-node.completed .step-label {
	color: var(--stape-accent);
}

/* --- Step Content --- */
.stape-wizard-step {
	display: none;
	opacity: 0;
	transform: translateY(15px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.stape-wizard-step.active {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

.stape-step-title {
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 8px 0;
	background: linear-gradient(to right, #fff, var(--stape-text-muted));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.stape-step-subtitle {
	font-size: 14px;
	color: var(--stape-text-muted);
	margin: 0 0 32px 0;
	line-height: 1.6;
}

/* --- Form Fields & Design System --- */
.stape-form-row {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
}

.stape-form-row .stape-form-group {
	flex: 1;
	margin-bottom: 0;
}

.stape-form-group {
	margin-bottom: 24px;
	display: flex;
	flex-direction: column;
	position: relative;
}

.stape-form-group label {
	font-size: 14px;
	font-weight: 500;
	color: var(--stape-text-main);
	margin-bottom: 8px;
	display: flex;
	align-items: center;
}

.stape-form-group label .tooltip-info {
	margin-left: 6px;
	color: var(--stape-text-muted);
	cursor: help;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
}

.stape-form-group input[type="text"],
.stape-form-group input[type="email"],
.stape-form-group input[type="password"],
.stape-form-group select,
.stape-form-group textarea {
	background: var(--stape-input-bg);
	border: 1px solid var(--stape-input-border);
	border-radius: 12px;
	padding: 12px 16px;
	font-size: 15px;
	font-family: inherit;
	color: var(--stape-text-main);
	outline: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
}

.stape-form-group input:focus,
.stape-form-group select:focus,
.stape-form-group textarea:focus {
	border-color: var(--stape-primary);
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
	background: rgba(15, 23, 42, 0.8);
}

.stape-form-group input::placeholder,
.stape-form-group textarea::placeholder {
	color: rgba(255, 255, 255, 0.25);
}

.stape-error-hint {
	color: var(--stape-danger);
	font-size: 12px;
	margin-top: 6px;
	display: none;
	animation: fadeIn 0.3s ease;
}

/* --- Password Hide/Show Wrapper --- */
.stape-password-wrapper {
	position: relative;
	width: 100%;
}

.stape-password-wrapper input {
	padding-right: 48px;
}

.stape-toggle-password {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--stape-text-muted);
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.stape-toggle-password:hover {
	color: var(--stape-text-main);
}

.stape-toggle-password svg {
	width: 20px;
	height: 20px;
}

/* --- Password Strength Checker UI --- */
.stape-password-strength-checker {
	margin-top: 14px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 12px;
	padding: 16px;
}

.stape-password-strength-checker .checker-title {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 10px 0;
	color: var(--stape-text-muted);
}

.stape-password-strength-checker .checker-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.stape-password-strength-checker .checker-list li {
	font-size: 13px;
	display: flex;
	align-items: center;
	transition: all 0.3s ease;
}

.stape-password-strength-checker .checker-list li .rule-icon {
	margin-right: 8px;
	font-weight: bold;
	display: inline-flex;
	width: 16px;
	justify-content: center;
}

.stape-password-strength-checker .checker-list li.rule-invalid {
	color: var(--stape-text-muted);
	opacity: 0.7;
}

.stape-password-strength-checker .checker-list li.rule-invalid .rule-icon {
	color: var(--stape-danger);
}

.stape-password-strength-checker .checker-list li.rule-valid {
	color: var(--stape-accent);
	font-weight: 500;
	transform: translateX(4px);
}

.stape-password-strength-checker .checker-list li.rule-valid .rule-icon {
	color: var(--stape-accent);
	content: "✓";
}

/* --- Buttons Design & Spinner --- */
.stape-form-actions {
	display: flex;
	gap: 16px;
	margin-top: 32px;
}

.stape-form-actions.align-center {
	justify-content: center;
}

.stape-btn {
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	border-radius: 12px;
	padding: 12px 28px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	outline: none;
}

.stape-btn-primary {
	background: linear-gradient(135deg, var(--stape-primary) 0%, var(--stape-secondary) 100%);
	border: none;
	color: #fff;
	box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.stape-btn-primary:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.stape-btn-primary:active:not(:disabled) {
	transform: translateY(0);
}

.stape-btn-primary:disabled {
	background: #1e293b;
	color: var(--stape-text-muted);
	cursor: not-allowed;
	box-shadow: none;
	opacity: 0.6;
}

.stape-btn-secondary {
	background: transparent;
	border: 1px solid var(--stape-input-border);
	color: var(--stape-text-main);
}

.stape-btn-secondary:hover {
	background: rgba(255, 255, 255, 0.05);
	border-color: var(--stape-text-muted);
}

.stape-btn-large {
	padding: 16px 36px;
	font-size: 16px;
	border-radius: 16px;
}

.stape-btn svg.icon-right {
	margin-left: 10px;
	transition: transform 0.2s ease;
}

.stape-btn:hover svg.icon-right {
	transform: translate(3px, -3px);
}

/* Spinner element for submitting states */
.stape-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: spin 0.8s linear infinite;
	margin-left: 10px;
	display: none;
}

.stape-btn.loading .stape-spinner {
	display: inline-block;
}

.stape-btn.loading span {
	opacity: 0.8;
}

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

/* --- Advanced Config Accordion --- */
.stape-accordion {
	margin-top: 24px;
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.01);
	overflow: hidden;
}

.stape-accordion-header {
	width: 100%;
	background: transparent;
	border: none;
	padding: 16px 20px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--stape-text-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: all 0.3s ease;
	outline: none;
}

.stape-accordion-header:hover {
	color: var(--stape-text-main);
	background: rgba(255, 255, 255, 0.02);
}

.stape-accordion-header .chevron {
	transition: transform 0.3s ease;
}

.stape-accordion.open .stape-accordion-header {
	color: var(--stape-text-main);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stape-accordion.open .stape-accordion-header .chevron {
	transform: rotate(180deg);
}

.stape-accordion-content {
	padding: 20px;
	overflow: hidden;
}

.stape-accordion.open .stape-accordion-content {
	padding: 20px;
	opacity: 1;
}

.stape-checkbox-group {
	margin-top: 14px;
}

.stape-checkbox-label {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-size: 13px;
	color: var(--stape-text-muted);
}

.stape-checkbox-label input[type="checkbox"] {
	margin-right: 10px;
	width: 16px;
	height: 16px;
	accent-color: var(--stape-primary);
	cursor: pointer;
}

/* --- Alerts and Errors --- */
.stape-alert {
	padding: 16px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
	margin-top: 24px;
	display: none;
	animation: fadeIn 0.3s ease;
}

.stape-alert-danger {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.2);
	color: #fca5a5;
}

/* --- Success Screen Design --- */
.stape-success-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 20px 0;
}

.stape-success-icon-wrapper {
	width: 80px;
	height: 80px;
	margin-bottom: 24px;
}

.stape-success-details {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 16px;
	padding: 24px;
	width: 100%;
	max-width: 440px;
	margin: 24px 0 32px 0;
	text-align: left;
}

.stape-success-details p {
	margin: 0 0 12px 0;
	font-size: 14px;
	color: var(--stape-text-muted);
	display: flex;
	justify-content: space-between;
	border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
	padding-bottom: 12px;
}

.stape-success-details p:last-child {
	margin-bottom: 0;
	border-bottom: none;
	padding-bottom: 0;
}

.stape-success-details p strong {
	color: var(--stape-text-main);
	font-weight: 600;
}

.stape-success-details p span {
	font-family: monospace;
	font-size: 13px;
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
	padding: 2px 8px;
	border-radius: 6px;
}

/* --- Confetti Checkmark Animations --- */
.checkmark__circle {
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
	stroke-width: 2;
	stroke-miterlimit: 10;
	stroke: var(--stape-accent);
	fill: none;
	animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: block;
	stroke-width: 2;
	stroke: #fff;
	stroke-miterlimit: 10;
	box-shadow: inset 0px 0px 0px var(--stape-accent);
	animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s forwards;
}

.checkmark__check {
	transform-origin: 50% 50%;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
	100% {
		stroke-dashoffset: 0;
	}
}

@keyframes fill {
	100% {
		box-shadow: inset 0px 0px 0px 40px var(--stape-accent);
	}
}

@keyframes scale {

	0%,
	100% {
		transform: none;
	}

	50% {
		transform: scale3d(1.1, 1.1, 1);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
	.stape-wizard-container {
		padding: 24px;
		margin: 20px 10px;
	}

	.stape-form-row {
		flex-direction: column;
		gap: 0;
	}

	.stape-form-row .stape-form-group {
		margin-bottom: 24px;
	}

	.stape-form-actions {
		flex-direction: column;
	}

	.stape-btn {
		width: 100%;
	}

	.stape-step-node .step-label {
		font-size: 11px;
	}
}