:root {
	--primary: #5b21b6;
	--primary-light: #f5f3ff;
	--primary-hover: #4c1d95;
	--text-main: #111827;
	--text-muted: #6b7280;
	--border: #e5e7eb;
	--bg-page: #fafafa;
	--bg-card: #ffffff;
	--success: #10b981;
}

.onboarding-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	color: var(--text-main);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Header */
.onboarding-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0 30px 0;
	border-bottom: 1px solid var(--border);
	margin-bottom: 30px;
}

.header-brand h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.header-brand p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

.header-actions { display: flex; align-items: center; gap: 20px; }
.help-btn {
	background: white; border: 1px solid var(--border); border-radius: 20px;
	padding: 6px 16px; font-size: 0.85rem; font-weight: 500; cursor: pointer;
	display: flex; align-items: center; gap: 8px; color: var(--text-muted);
}
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: #ddd; object-fit: cover;}

/* Progress Bar */
.progress-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 40px;
	position: relative;
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}
.progress-container::before {
	content: ''; position: absolute; top: 20px; left: 0; right: 0;
	height: 2px; background: var(--border); z-index: 1;
}
.progress-line-fill {
	position: absolute; top: 20px; left: 0; height: 2px;
	background: var(--primary); z-index: 2; transition: width 0.3s ease;
	width: 0%;
}

.step-indicator {
	position: relative; z-index: 3; display: flex; flex-direction: column;
	align-items: center; gap: 8px; width: 100px; text-align: center;
}
.step-circle {
	width: 40px; height: 40px; border-radius: 50%; background: white;
	border: 2px solid var(--border); display: flex; align-items: center;
	justify-content: center; font-weight: 600; color: var(--text-muted);
	transition: 0.3s;
}
.step-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.step-indicator.active .step-circle {
	border-color: var(--primary); background: var(--primary); color: white;
}
.step-indicator.active .step-label { color: var(--primary); font-weight: 600; }
.step-indicator.completed .step-circle {
	border-color: var(--primary); background: var(--primary); color: white;
}

/* Main Layout Grid */
.layout-grid {
	display: grid;
	grid-template-columns: 1fr 350px;
	gap: 40px;
	align-items: start;
}

/* Form Area */
.form-area {
	background: var(--bg-card);
	padding: 40px;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.03);
	border: 1px solid var(--border);
}

.step-content { display: none; }
.step-content.active { display: block; animation: fadeIn 0.4s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.step-header { margin-bottom: 30px; }
.step-meta { font-size: 0.85rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: block; }
.step-header h2 { margin: 0 0 8px 0; font-size: 1.8rem; }
.step-header p { margin: 0; color: var(--text-muted); }

/* Form Controls */
.form-group { margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.95rem; }
.form-control {
	width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 8px;
	font-size: 1rem; box-sizing: border-box; background: white;
	height: auto !important; /* Fix for theme height conflicts */
	min-height: 52px; /* Ensure text isn't cut off */
	line-height: normal;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Selectable Cards (Radio replacements) */
.card-selector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.card-selector { position: relative; }
.card-selector input[type="radio"], .card-selector input[type="checkbox"] { display: none; }
.card-label {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	text-align: center; padding: 30px 20px; border: 2px solid var(--border);
	border-radius: 12px; cursor: pointer; transition: 0.2s; background: white; height: 100%; box-sizing: border-box;
}
.card-icon {
	width: 60px; height: 60px; border-radius: 50%; background: var(--primary-light);
	display: flex; align-items: center; justify-content: center; color: var(--primary);
	margin-bottom: 16px;
}
.card-icon svg { width: 30px; height: 30px; }
.card-label h4 { margin: 0 0 8px 0; font-size: 1.1rem; }
.card-label p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.card-selector input:checked + .card-label {
	border-color: var(--primary); background: var(--primary-light); box-shadow: 0 4px 12px rgba(91, 33, 182, 0.1);
}

/* Standard Checkbox/Radio Grid */
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.option-item {
	display: flex; align-items: center; gap: 10px; padding: 12px 16px;
	border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.option-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.option-item:hover { background: #f9fafb; }
.option-item.selected { border-color: var(--primary); background: var(--primary-light); }

/* Buttons */
.btn-wrapper { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.btn { padding: 14px 28px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; border: none; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f9fafb; }

/* Utility */
.info-box {
	background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px;
	display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; color: #1e3a8a; font-size: 0.9rem;
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.sidebar-card h3 { margin: 0 0 16px 0; font-size: 1.1rem; }
.sidebar-card p { font-size: 0.9rem; color: var(--text-muted); margin-top: 0; line-height: 1.5; }

.sidebar-list { display: flex; flex-direction: column; gap: 16px; }
.sidebar-list-item { display: flex; align-items: flex-start; gap: 12px; }
.sidebar-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-icon svg { width: 16px; height: 16px; }
.sidebar-text h4 { margin: 0 0 4px 0; font-size: 0.95rem; }
.sidebar-text p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* --- Auth Styles --- */
.auth-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Top Navigation */
.auth-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 0 40px 0;
}

.auth-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 700;
	font-size: 1.2rem;
	color: #111827;
	text-decoration: none;
}

.auth-logo-icon {
	width: 32px;
	height: 32px;
	background: var(--primary);
	color: white;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.auth-login-link {
	font-size: 0.95rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 16px;
}

.auth-login-btn {
	padding: 8px 24px;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
	transition: 0.2s;
}

.auth-login-btn:hover {
	border-color: var(--primary);
	background: #f8fafc;
}

/* Main Split Content */
.auth-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 60px;
	align-items: start;
}

/* Left Side: Features */
.auth-info-side h1 {
	font-size: 2.8rem;
	line-height: 1.2;
	margin: 0 0 16px 0;
	color: #111827;
}
.auth-info-side h1 span {
	color: var(--primary);
}

.auth-info-side > p {
	font-size: 1.1rem;
	color: var(--text-muted);
	line-height: 1.6;
	margin-bottom: 40px;
	max-width: 90%;
}

.feature-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-bottom: 40px;
}

.feature-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.feature-icon {
	width: 40px;
	height: 40px;
	background: var(--primary);
	color: white;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.feature-icon svg {
	width: 20px !important;
	height: 20px !important;
}

.feature-text h4 {
	margin: 0 0 4px 0;
	font-size: 1.05rem;
	font-weight: 600;
}

.feature-text p {
	margin: 0;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.promo-box {
	background: #f3e8ff;
	padding: 20px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	gap: 16px;
}

.promo-icon {
	color: var(--primary);
}
.promo-icon svg { width: 32px; height: 32px; }

.promo-text h4 { margin: 0 0 4px 0; font-size: 1rem; color: #4c1d95; }
.promo-text p { margin: 0; font-size: 0.85rem; color: #6b7280; }


/* Right Side: Form Card */
.auth-form-card {
	background: var(--bg-card);
	padding: 40px;
	border-radius: 16px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.05);
	border: 1px solid var(--border);
}

.form-header { text-align: center; margin-bottom: 30px; }
.form-header h2 { margin: 0 0 8px 0; font-size: 1.5rem; }
.form-header p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 24px;
}

.full-width { grid-column: span 2; }

.input-group {
	position: relative;
	display: flex;
	align-items: center;
}

.input-group svg {
	position: absolute;
	left: 14px;
	color: #9ca3af;
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.input-group input, .input-group select {
	width: 100%;
	padding: 14px 14px 14px 40px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 0.95rem;
	color: var(--text-main);
	background: #fff;
	outline: none;
	transition: border-color 0.2s;
	box-sizing: border-box;
	appearance: none;
	height: auto !important;
	min-height: 52px;
	line-height: normal;
}

.input-group input:focus, .input-group select:focus {
	border-color: var(--primary);
}

.input-group.no-icon select { padding-left: 14px; }
.input-group.no-icon input { padding-left: 14px; }

.input-group.has-right-icon input { padding-right: 40px; }

.toggle-password {
	position: absolute;
	right: 14px;
	left: auto;
	cursor: pointer;
	pointer-events: auto !important;
}

.select-wrapper { position: relative; }
.select-wrapper select { padding-top: 22px; padding-bottom: 6px; }
.select-label {
	position: absolute;
	left: 14px;
	top: 6px;
	font-size: 0.7rem;
	color: #9ca3af;
	pointer-events: none;
}
.select-wrapper::after {
	content: '\25BC';
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.6rem;
	color: #9ca3af;
	pointer-events: none;
}

.terms-group {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.85rem;
	color: var(--text-muted);
	margin-bottom: 24px;
}

.terms-group input { margin-top: 3px; accent-color: var(--primary); }
.terms-group a { color: var(--primary); text-decoration: none; }

.submit-btn {
	width: 100%;
	padding: 16px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: 0.2s;
}
.submit-btn:hover { background: var(--primary-hover); }

.form-footer {
	text-align: center;
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 16px;
}

.stats-section {
	display: flex;
	justify-content: space-between;
	margin-top: 60px;
	padding-top: 40px;
	border-top: 1px solid var(--border);
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 12px;
}

.stat-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f3e8ff;
	color: var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; }

.stat-info h4 { margin: 0; font-size: 1.1rem; font-weight: 700; color: #111827; }
.stat-info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.error-notice {
	background: #fee2e2;
	color: #b91c1c;
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 0.9rem;
	border: 1px solid #fecaca;
}

@media(max-width: 992px) {
	.layout-grid { grid-template-columns: 1fr; }
	.sidebar { display: none; }
	.progress-label { display: none; }
	.step-indicator { width: auto; }
	.card-selector-grid { grid-template-columns: 1fr; }
	.grid-2 { grid-template-columns: 1fr; }
	.auth-content { grid-template-columns: 1fr; gap: 40px; }
	.auth-info-side { text-align: center; }
	.auth-info-side > p { margin: 0 auto 40px auto; }
	.feature-list { text-align: left; max-width: 400px; margin: 0 auto 40px auto; }
	.promo-box { max-width: 400px; margin: 0 auto; text-align: left; }
	.stats-section { flex-wrap: wrap; gap: 20px; justify-content: center; }
}

@media(max-width: 600px) {
	.form-grid { grid-template-columns: 1fr; }
	.full-width { grid-column: span 1; }
}

/* --- Streak Widget --- */
.ielts-streak-widget {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--border);
	padding: 12px 20px;
	border-radius: 12px;
	box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.ielts-streak-widget .streak-icon {
	color: #f97316; /* orange */
	background: #fff7ed;
	padding: 10px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ielts-streak-widget .streak-icon svg {
	width: 24px;
	height: 24px;
}
.ielts-streak-widget .streak-text {
	display: flex;
	flex-direction: column;
}
.ielts-streak-widget .streak-count {
	font-size: 1.25rem;
	font-weight: 800;
	color: #111827;
	line-height: 1.2;
}
.ielts-streak-widget .streak-label {
	font-size: 0.8rem;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
}

/* --- Profile Completion Widget --- */
.ielts-profile-completion-widget {
	position: relative;
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
}
.completion-ring {
	position: relative;
	width: 60px;
	height: 60px;
}
.completion-ring svg {
	transform: rotate(-90deg);
}
.completion-ring .ring-bg {
	stroke: var(--border);
}
.completion-ring .ring-progress {
	stroke: var(--primary);
	stroke-linecap: round;
	transition: stroke-dashoffset 1s ease-out;
}
.completion-percent {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.85rem;
	font-weight: 700;
	color: #111827;
}

/* Hover Card */
.completion-hover-card {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	background: #fff;
	border: 1px solid var(--border);
	box-shadow: 0 10px 25px rgba(0,0,0,0.1);
	padding: 20px;
	border-radius: 12px;
	width: 260px;
	opacity: 0;
	visibility: hidden;
	transition: 0.3s all ease;
	z-index: 100;
	pointer-events: none;
}
.ielts-profile-completion-widget:hover .completion-hover-card {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(5px);
}
.completion-hover-card::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 12px;
	height: 12px;
	background: #fff;
	border-top: 1px solid var(--border);
	border-left: 1px solid var(--border);
}
.completion-hover-card h4 {
	margin: 0 0 8px 0;
	color: #111827;
	font-size: 1.05rem;
}
.completion-hover-card p {
	margin: 0 0 12px 0;
	font-size: 0.85rem;
	color: var(--text-muted);
}
.completion-hover-card ul {
	margin: 0 0 16px 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
	color: #b91c1c; /* red-700 */
}
.completion-hover-card ul li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}
.btn-complete-now {
	display: inline-block;
	background: var(--primary);
	color: white;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 600;
}
