/**
 * FundSys App Styles
 * Konsolidierte App-spezifische Styles für Auth-Seiten, Settings und wiederverwendbare UI-Elemente
 * 
 * Hinweis: Die Brand-Farbe wird dynamisch via --fs-brand-primary gesetzt (White-Labeling)
 */

/* ========== GLASS PANEL ========== */
.glass-panel {
	background: rgba(242, 244, 246, 0.85);
	backdrop-filter: blur(20px);
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
	border-radius: 0.125rem;
}

.dark .glass-panel {
	background: rgba(19, 27, 46, 0.85);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ========== INPUT FIELDS ========== */
.input-field {
	background: transparent;
	border: none;
	border-bottom: 2px solid rgba(198, 198, 205, 0.5);
	color: #191c1e;
	transition: all 0.3s ease;
	border-radius: 0;
	box-shadow: inset 0 -4px 8px -4px rgba(0, 0, 0, 0.04);
}

.dark .input-field {
	background: transparent;
	border-bottom: 2px solid rgba(255, 255, 255, 0.25);
	color: #eff1f3;
	box-shadow: inset 0 -4px 8px -4px rgba(255, 255, 255, 0.04);
}

.input-field:focus {
	border-bottom-color: var(--fs-brand-primary, #131b2e);
	outline: none;
	background: rgba(0, 0, 0, 0.02);
	box-shadow: inset 0 -4px 8px -4px rgba(0, 0, 0, 0.08);
}

.dark .input-field:focus {
	border-bottom-color: #e9c176;
	background: rgba(255, 255, 255, 0.03);
	box-shadow: inset 0 -4px 8px -4px rgba(233, 193, 118, 0.15);
}


/* ========== BUTTONS ========== */
/* login-btn is an alias for primary-btn */
.login-btn,
.primary-btn {
	background: var(--fs-brand-primary, #131b2e);
	color: white;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	border-radius: 0.125rem;
}

.login-btn:hover:not(:disabled),
.primary-btn:hover:not(:disabled) {
	filter: brightness(1.15);
	box-shadow: 0 6px 20px rgba(var(--fs-brand-primary-rgb, 19, 27, 46), 0.3);
}

.login-btn:disabled,
.primary-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

/* ========== BACKGROUND ORBS ========== */
.orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	z-index: -1;
	opacity: 0.4;
}

.orb-1 {
	width: 500px;
	height: 500px;
	background: var(--fs-brand-primary, #131b2e);
	top: -100px;
	left: -100px;
	animation: orb-float 10s ease-in-out infinite alternate;
}

.orb-2 {
	width: 600px;
	height: 600px;
	background: var(--fs-brand-primary, #131b2e);
	bottom: -200px;
	right: -100px;
	animation: orb-float 12s ease-in-out infinite alternate-reverse;
}

.orb-3 {
	width: 300px;
	height: 300px;
	background: var(--fs-gold, #e9c176);
	top: 40%;
	left: 60%;
	opacity: 0.12;
	animation: orb-float 8s ease-in-out infinite alternate;
}

@keyframes orb-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}

/* #57 — Hide orbs when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
	.orb { display: none; }
}

/* #57 — Hide orbs on small screens */
@media (max-width: 639px) {
	.orb { display: none; }
}

/* #56 — Smooth theme transition */
html.fs-theme-transition,
html.fs-theme-transition *,
html.fs-theme-transition *::before,
html.fs-theme-transition *::after {
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
	html.fs-theme-transition,
	html.fs-theme-transition *,
	html.fs-theme-transition *::before,
	html.fs-theme-transition *::after {
		transition: none !important;
	}
}

/* ========== MESSAGE BOXES ========== */
@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-6px); }
	75% { transform: translateX(6px); }
}

/* ========== SPINNER ========== */
.spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

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

/* ========== SUCCESS OVERLAY ========== */
.success-overlay {
	position: fixed;
	inset: 0;
	background: rgba(11, 28, 45, 0.95);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.success-overlay.visible {
	opacity: 1;
	pointer-events: all;
}

.checkmark {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--fs-brand-primary, #131b2e), #10b981);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
	from { transform: scale(0); }
	to { transform: scale(1); }
}

/* ========== SETTINGS TABS ========== */
.settings-tab[aria-selected="true"] {
	background: #ffffff;
	color: var(--fs-brand-primary, #131b2e);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.dark .settings-tab[aria-selected="true"] {
	background: rgba(var(--fs-brand-primary-rgb, 19, 27, 46), 0.15);
	color: var(--fs-brand-primary, #131b2e);
	border-color: rgba(var(--fs-brand-primary-rgb, 19, 27, 46), 0.3);
}

/* ========== UTILITY: GWC-SELECT (Custom Select Dropdown) ========== */
.fs-select {
	background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239CA3AF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 0.65em auto;
	appearance: none;
}

/* ========== INPUT ERROR STATE ========== */
.fs-input-error {
	border-color: var(--fs-error, #ba1a1a) !important;
	background: rgba(186, 26, 26, 0.05) !important;
}

.fs-input-error:focus {
	box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.15) !important;
}

/* ========== PASSWORD STRENGTH INDICATOR ========== */
.password-strength {
	height: 4px;
	background: #e2e8f0;
	border-radius: 2px;
	margin-top: 0.5rem;
	overflow: hidden;
}

.dark .password-strength {
	background: rgba(255, 255, 255, 0.1);
}

.password-strength-bar {
	height: 100%;
	width: 0;
	transition: all 0.3s ease;
	border-radius: 2px;
}

.password-strength-text {
	font-size: 0.75rem;
	margin-top: 0.25rem;
	color: #64748b;
}

.dark .password-strength-text {
	color: #6b859e;
}

/* ========== MESSAGE BOX (ALTERNATIVE NAMING) ========== */
.message-box {
	display: none;
	border-radius: 0.125rem;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	animation: shake 0.35s ease;
}

.message-box.error {
	background: rgba(186, 26, 26, 0.08);
	color: #ba1a1a;
}

.message-box.success {
	background: rgba(46, 125, 50, 0.08);
	color: #2e7d32;
}

.dark .message-box.error {
	background: rgba(239, 83, 80, 0.12);
	color: #ef5350;
}

.dark .message-box.success {
	background: rgba(102, 187, 106, 0.12);
	color: #66bb6a;
}


/* ========== FORGOT PASSWORD BOX ========== */
#login-forgot-box {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 0.25s ease,
	            margin-top 0.3s ease;
	margin-top: 0;
}

#login-forgot-box.open {
	max-height: 120px;
	opacity: 1;
	margin-top: 0.25rem;
}

/* ========== SETTINGS TABS: MOBILE SCROLL-INDIKATOR ========== */
@media (max-width: 1023px) {
	#settings-tabs-nav-wrapper {
		position: relative;
	}

	/* Fade-out am rechten Rand zeigt an, dass noch mehr Tabs vorhanden sind */
	#settings-tabs-nav-wrapper::after {
		content: '';
		position: absolute;
		top: 0;
		right: 0;
		bottom: 4px; /* pb-1 ausgleichen */
		width: 3rem;
		background: linear-gradient(to right, transparent, var(--fs-bg-primary, #ffffff));
		pointer-events: none;
		z-index: 1;
		border-radius: 0 0.75rem 0.75rem 0;
	}

	.dark #settings-tabs-nav-wrapper::after {
		background: linear-gradient(to right, transparent, var(--fs-bg-primary, #0B1C2D));
	}

	/* Gradient ausblenden, wenn komplett nach rechts gescrollt */
	#settings-tabs-nav-wrapper.scroll-end::after {
		display: none;
	}
}

/* ========== SETTINGS PANELS ========== */
.settings-panel {
	display: none;
	animation: settings-fadeIn 0.2s ease;
}

.settings-panel.active {
	display: block;
}

@keyframes settings-fadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}