/* ════════════════════════════════════════════════════════════════════
   Equalza Auth — Modal, Profile Page, Favorites, Avatar styles
   Uses existing CSS variables from equalza.css
   ════════════════════════════════════════════════════════════════════ */

/* ── Auth Modal Overlay ────────────────────────────────────────────── */
.eq-auth-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 400;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
	padding: 16px;
}
.eq-auth-overlay.open {
	opacity: 1;
	visibility: visible;
}

.eq-auth-modal {
	background: var(--surface, #fff);
	border-radius: var(--rl, 12px);
	width: 100%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 32px;
	position: relative;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
	transform: translateY(20px);
	transition: transform .2s ease;
}
.eq-auth-overlay.open .eq-auth-modal {
	transform: translateY(0);
}

.eq-auth-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: var(--bg, #f5f6f8);
	color: var(--text2, #4b5563);
	font-size: 20px;
	cursor: pointer;
	transition: background .15s;
	line-height: 1;
}
.eq-auth-close:hover { background: var(--border, #e2e5ea); }

[dir="rtl"] .eq-auth-close { right: auto; left: 12px; }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.eq-auth-tabs {
	display: flex;
	background: var(--bg, #f5f6f8);
	border-radius: var(--r, 8px);
	padding: 4px;
	margin-bottom: 24px;
	gap: 4px;
}
.eq-auth-tab {
	flex: 1;
	padding: 10px 16px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--text2, #4b5563);
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.eq-auth-tab.active {
	background: var(--surface, #fff);
	color: var(--text, #111827);
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.eq-auth-form { display: flex; flex-direction: column; gap: 14px; }

.eq-auth-input {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--border, #e2e5ea);
	border-radius: var(--r, 8px);
	font-size: .95rem;
	color: var(--text, #111827);
	background: var(--surface, #fff);
	transition: border-color .15s, box-shadow .15s;
	outline: none;
	box-sizing: border-box;
}
.eq-auth-input:focus {
	border-color: var(--accent, #2563eb);
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.eq-auth-input::placeholder { color: var(--text3, #9ca3af); }

.eq-auth-submit {
	width: 100%;
	padding: 13px 24px;
	border: none;
	border-radius: var(--r, 8px);
	background: linear-gradient(135deg, var(--accent, #2563eb), var(--accent-h, #1d4ed8)) !important;
	color: #fff !important;
	font-size: .95rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform .15s, box-shadow .15s;
}
.eq-auth-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.eq-auth-submit:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}

.eq-auth-forgot-link, .eq-auth-back-link {
	background: none;
	border: none;
	color: var(--accent, #2563eb);
	font-size: .85rem;
	cursor: pointer;
	text-align: center;
	padding: 4px;
}
.eq-auth-forgot-link:hover, .eq-auth-back-link:hover { text-decoration: underline; }

.eq-auth-error {
	background: var(--red-bg, #fef2f2);
	color: var(--red, #dc2626);
	padding: 10px 14px;
	border-radius: var(--r, 8px);
	font-size: .85rem;
	line-height: 1.4;
}

.eq-auth-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .85rem;
	color: var(--text2, #4b5563);
	cursor: pointer;
}
.eq-auth-checkbox input { width: 16px; height: 16px; accent-color: var(--accent, #2563eb); }

.eq-auth-terms {
	font-size: .8rem;
	color: var(--text3, #9ca3af);
	text-align: center;
	line-height: 1.5;
	margin: 0;
}
.eq-auth-terms a { color: var(--accent, #2563eb); text-decoration: none; }
.eq-auth-terms a:hover { text-decoration: underline; }

.eq-auth-form-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--text, #111827);
	margin: 0 0 8px;
	text-align: center;
}
.eq-auth-form-desc {
	font-size: .9rem;
	color: var(--text2, #4b5563);
	text-align: center;
	margin: 0 0 8px;
	line-height: 1.5;
}

.eq-auth-verify-icon {
	font-size: 48px;
	text-align: center;
	margin: 8px 0 16px;
	color: var(--accent, #2563eb);
}

/* ── Social Buttons ────────────────────────────────────────────────── */
.eq-auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 8px 0;
	color: var(--text3, #9ca3af);
	font-size: .85rem;
}
.eq-auth-divider::before, .eq-auth-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border, #e2e5ea);
}

.eq-auth-social { display: flex; flex-direction: column; gap: 10px; }

.eq-auth-social-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 11px 16px;
	border: 1px solid var(--border, #e2e5ea);
	border-radius: var(--r, 8px);
	background: var(--surface, #fff);
	color: var(--text, #111827);
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.eq-auth-social-btn:hover {
	background: var(--bg, #f5f6f8);
	border-color: var(--border2, #c8cdd6);
}
.eq-auth-social-btn svg { flex-shrink: 0; }

/* ── Topbar Auth Button ────────────────────────────────────────────── */
.eq-auth-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,.12);
	border: 1px solid rgba(255,255,255,.18);
	color: #fff;
	padding: 7px 16px;
	border-radius: var(--r, 8px);
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s;
	white-space: nowrap;
}
.eq-auth-btn:hover {
	background: rgba(255,255,255,.2);
	border-color: rgba(255,255,255,.3);
}
.eq-auth-btn svg { width: 18px; height: 18px; }

.eq-auth-avatar-img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 2px solid rgba(255,255,255,.25);
	transition: border-color .15s;
}
.eq-auth-avatar-img:hover { border-color: rgba(255,255,255,.5); }

/* ── Avatar Dropdown Menu ─────────────────────────────────────────── */
.eq-avatar-wrap {
	position: relative;
}
.eq-avatar-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.eq-avatar-menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.08);
	min-width: 180px;
	padding: 6px;
	z-index: 10001;
	animation: eqFadeIn .15s ease;
}
[dir="rtl"] .eq-avatar-menu {
	right: auto;
	left: 0;
}
.eq-avatar-wrap.open .eq-avatar-menu {
	display: block;
}
.eq-avatar-menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 7px;
	color: #1e293b;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: background .15s;
	white-space: nowrap;
}
.eq-avatar-menu-item:hover {
	background: #f1f5f9;
}
.eq-avatar-menu-item svg {
	flex-shrink: 0;
	color: #64748b;
}
.eq-avatar-logout {
	color: #dc2626;
}
.eq-avatar-logout svg {
	color: #dc2626;
}
.eq-avatar-logout:hover {
	background: #fef2f2;
}
@keyframes eqFadeIn {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ── Topbar Login Button ──────────────────────────────────────────── */
.eq-topbar-login {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1px solid rgba(255,255,255,.18);
	border-radius: var(--r, 8px);
	background: rgba(255,255,255,.08);
	color: rgba(255,255,255,.9);
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s;
	white-space: nowrap;
}
.eq-topbar-login:hover {
	background: rgba(255,255,255,.15);
	border-color: rgba(255,255,255,.3);
}
.eq-topbar-login svg { flex-shrink: 0; }

.eq-auth-avatar {
	display: flex;
	align-items: center;
	text-decoration: none;
}

/* ── Favorite Heart Button ─────────────────────────────────────────── */
.eq-fav-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,.9);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: var(--text3, #9ca3af);
	transition: color .15s, transform .15s, background .15s;
	z-index: 5;
	padding: 0;
}
.eq-fav-btn:hover {
	color: var(--red, #dc2626);
	transform: scale(1.1);
	background: #fff;
}
.eq-fav-btn.eq-fav-active {
	color: var(--red, #dc2626);
}
.eq-fav-btn svg { width: 18px; height: 18px; pointer-events: none; }
.eq-fav-btn.eq-fav-active svg { fill: currentColor; }

[dir="rtl"] .eq-fav-btn { right: auto; left: 10px; }

/* Mega menu heart (inline, smaller) */
.eq-mega-fav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text3, #9ca3af);
	transition: color .15s;
	padding: 0;
	margin-inline-start: auto;
	flex-shrink: 0;
}
.eq-mega-fav:hover, .eq-mega-fav.eq-fav-active { color: var(--red, #dc2626); }
.eq-mega-fav.eq-fav-active svg { fill: currentColor; }
.eq-mega-fav svg { width: 16px; height: 16px; pointer-events: none; }

/* ── Profile Page ──────────────────────────────────────────────────── */
.eq-profile-page {
	min-height: 100vh;
	background: var(--bg, #f5f6f8);
	padding: 40px 16px 80px;
}
.eq-profile-container {
	max-width: 680px;
	margin: 0 auto;
}

/* Login CTA */
.eq-profile-login-cta {
	text-align: center;
	padding: 80px 24px;
	background: var(--surface, #fff);
	border-radius: var(--rl, 12px);
	box-shadow: var(--sh);
}
.eq-profile-login-icon { color: var(--text3, #9ca3af); margin-bottom: 16px; }
.eq-profile-login-cta h2 {
	font-size: 1.2rem;
	color: var(--text, #111827);
	margin: 0 0 24px;
}

/* Header */
.eq-profile-header {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 28px;
	background: var(--surface, #fff);
	border-radius: var(--rl, 12px);
	box-shadow: var(--sh);
	margin-bottom: 24px;
}
.eq-profile-avatar-lg {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 3px solid var(--accent-light, #eff6ff);
}
.eq-profile-name {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--text, #111827);
	margin: 0 0 4px;
}
.eq-profile-email {
	font-size: .9rem;
	color: var(--text2, #4b5563);
	margin: 0;
}

/* Tabs */
.eq-profile-tabs {
	display: flex;
	background: var(--surface, #fff);
	border-radius: var(--rl, 12px);
	padding: 6px;
	margin-bottom: 24px;
	box-shadow: var(--sh);
	gap: 4px;
}
.eq-profile-tab {
	flex: 1;
	padding: 12px 16px;
	border: none;
	border-radius: var(--r, 8px);
	background: transparent;
	color: var(--text2, #4b5563);
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.eq-profile-tab.active {
	background: var(--accent, #2563eb);
	color: #fff;
}

/* Panels */
.eq-profile-panel { display: none; }
.eq-profile-panel.active { display: block; }

.eq-profile-panel > .eq-profile-form,
.eq-settings-section {
	background: var(--surface, #fff);
	border-radius: var(--rl, 12px);
	padding: 28px;
	box-shadow: var(--sh);
	margin-bottom: 16px;
}

/* Form Elements */
.eq-profile-form { display: flex; flex-direction: column; gap: 18px; }

.eq-form-group { display: flex; flex-direction: column; gap: 6px; }
.eq-form-group label {
	font-size: .85rem;
	font-weight: 600;
	color: var(--text, #111827);
}

.eq-input {
	padding: 11px 14px;
	border: 1px solid var(--border, #e2e5ea);
	border-radius: var(--r, 8px);
	font-size: .9rem;
	color: var(--text, #111827);
	background: var(--surface, #fff);
	transition: border-color .15s, box-shadow .15s;
	outline: none;
	width: 100%;
	box-sizing: border-box;
}
.eq-input:focus {
	border-color: var(--accent, #2563eb);
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

select.eq-input { appearance: auto; }

/* Toggle Group */
.eq-toggle-group { display: flex; gap: 8px; }
.eq-toggle-btn {
	flex: 1;
	padding: 10px 16px;
	border: 1px solid var(--border, #e2e5ea);
	border-radius: var(--r, 8px);
	background: var(--surface, #fff);
	color: var(--text2, #4b5563);
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
}
.eq-toggle-btn.active {
	background: var(--accent, #2563eb);
	color: #fff;
	border-color: var(--accent, #2563eb);
}

/* Avatar Grid */
.eq-avatar-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.eq-avatar-option {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 2px solid var(--border, #e2e5ea);
	background: var(--bg, #f5f6f8);
	cursor: pointer;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color .15s, transform .15s;
	padding: 0;
}
.eq-avatar-option img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}
.eq-avatar-option:hover { transform: scale(1.08); }
.eq-avatar-option.active {
	border-color: var(--accent, #2563eb);
	box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}
.eq-avatar-upload-btn svg { color: var(--text3, #9ca3af); }

/* Checkbox */
.eq-checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: .9rem;
	color: var(--text, #111827);
	cursor: pointer;
}
.eq-checkbox-label input { width: 18px; height: 18px; accent-color: var(--accent, #2563eb); }

/* Form Actions */
.eq-form-actions { padding-top: 4px; }

/* Messages */
.eq-profile-msg {
	padding: 10px 14px;
	border-radius: var(--r, 8px);
	font-size: .85rem;
	margin-top: 4px;
}
.eq-msg-success { background: var(--green-bg, #ecfdf5); color: var(--green, #059669); }
.eq-msg-error { background: var(--red-bg, #fef2f2); color: var(--red, #dc2626); }

/* Favorites Grid (profile) */
.eq-profile-favorites-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}
.eq-fav-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 20px 12px;
	background: var(--surface, #fff);
	border: 1px solid var(--border, #e2e5ea);
	border-radius: var(--rl, 12px);
	text-decoration: none;
	color: var(--text, #111827);
	transition: transform .15s, box-shadow .15s;
}
.eq-fav-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--sh);
}
.eq-fav-card-icon { font-size: 28px; }
.eq-fav-card-name {
	font-size: .85rem;
	font-weight: 600;
	text-align: center;
	line-height: 1.3;
}

/* Settings Sections */
.eq-settings-section h3 {
	font-size: 1rem;
	font-weight: 700;
	color: var(--text, #111827);
	margin: 0 0 12px;
}

/* Danger Zone */
.eq-danger-zone {
	border: 1px solid var(--red, #dc2626);
}
.eq-danger-zone h3 { color: var(--red, #dc2626); }

/* Buttons */
.eq-btn-gradient {
	display: inline-block;
	padding: 12px 28px;
	border: none;
	border-radius: var(--r, 8px);
	background: linear-gradient(135deg, var(--accent, #2563eb), var(--accent-h, #1d4ed8)) !important;
	color: #fff !important;
	font-size: .9rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform .15s, box-shadow .15s;
}
.eq-btn-gradient:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.eq-btn-outline-dark {
	display: inline-block;
	padding: 10px 24px;
	border: 1px solid var(--border, #e2e5ea);
	border-radius: var(--r, 8px);
	background: var(--surface, #fff);
	color: var(--text, #111827);
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.eq-btn-outline-dark:hover { background: var(--bg, #f5f6f8); }

.eq-btn-danger {
	display: inline-block;
	padding: 10px 24px;
	border: none;
	border-radius: var(--r, 8px);
	background: var(--red, #dc2626);
	color: #fff;
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity .15s;
}
.eq-btn-danger:disabled { opacity: .4; cursor: not-allowed; }
.eq-btn-danger:hover:not(:disabled) { opacity: .9; }

/* ── Utilities ─────────────────────────────────────────────────────── */
.eq-hidden { display: none !important; }
.eq-mt-8 { margin-top: 8px; }
.eq-text-muted { color: var(--text3, #9ca3af); font-size: .9rem; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.eq-auth-modal { padding: 24px 20px; }
	.eq-profile-header { flex-direction: column; text-align: center; }
	.eq-profile-avatar-lg { width: 64px; height: 64px; }
	.eq-auth-btn .eq-auth-btn-label { display: none; }
	.eq-auth-btn { padding: 7px 10px; }
}
