/*
 * Rabattrechner – Stylesheet
 * Vollständig gekapselt unter dem Namensraum ".rbc-app", um Konflikte
 * mit dem WordPress-Theme oder anderen Plugins auf derselben Seite
 * zu vermeiden. Es werden ausschließlich Klassen-Selektoren mit dem
 * Präfix "rbc-" verwendet – keine globalen Element-Selektoren.
 */

.rbc-app {
	--rbc-color-bg: #ffffff;
	--rbc-color-surface: #f7f8fa;
	--rbc-color-border: #e3e6ea;
	--rbc-color-text: #1f2328;
	--rbc-color-text-muted: #6b7280;
	--rbc-color-primary: #3452ff;
	--rbc-color-primary-hover: #1735e1;
	--rbc-color-primary-contrast: #ffffff;
	--rbc-color-success: #16a34a;
	--rbc-color-success-bg: #f0fdf4;
	--rbc-radius-sm: 8px;
	--rbc-radius-md: 12px;
	--rbc-radius-lg: 16px;
	--rbc-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
	--rbc-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

	box-sizing: border-box;
	color: var(--rbc-color-text);
	font-family: inherit;
	line-height: 1.5;
	max-width: 960px;
	margin: 0 auto;
	isolation: isolate;
}

.rbc-app,
.rbc-app *,
.rbc-app *::before,
.rbc-app *::after {
	box-sizing: border-box;
}

.rbc-app *:where(:not(input, select, button)) {
	font-family: inherit;
}

.rbc-app input,
.rbc-app select,
.rbc-app button {
	font-family: inherit;
	font-size: 1em;
	color: inherit;
}

.rbc-card {
	background: var(--rbc-color-bg);
	border: 1px solid var(--rbc-color-border);
	border-radius: var(--rbc-radius-lg);
	box-shadow: var(--rbc-shadow);
	padding: 1.75rem;
	animation: rbc-fade-in 320ms ease both;
}

@keyframes rbc-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.rbc-header {
	margin-bottom: 1.25rem;
}

.rbc-title {
	font-size: 1.375rem;
	font-weight: 700;
	margin: 0 0 0.35rem;
	line-height: 1.3;
}

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

/* Tabs */
.rbc-tabs {
	display: flex;
	gap: 0.25rem;
	background: var(--rbc-color-surface);
	border: 1px solid var(--rbc-color-border);
	border-radius: var(--rbc-radius-md);
	padding: 0.25rem;
	margin-bottom: 1.5rem;
}

.rbc-tab {
	flex: 1 1 0;
	appearance: none;
	border: none;
	background: transparent;
	color: var(--rbc-color-text-muted);
	font-weight: 600;
	font-size: 0.875rem;
	padding: 0.6rem 0.75rem;
	border-radius: calc(var(--rbc-radius-md) - 4px);
	cursor: pointer;
	transition: background-color var(--rbc-transition), color var(--rbc-transition), box-shadow var(--rbc-transition);
}

.rbc-tab:hover {
	color: var(--rbc-color-text);
}

.rbc-tab.is-active {
	background: var(--rbc-color-bg);
	color: var(--rbc-color-primary);
	box-shadow: var(--rbc-shadow);
}

.rbc-tab:focus-visible,
.rbc-btn:focus-visible,
.rbc-input:focus-visible,
.rbc-select:focus-visible,
.rbc-icon-btn:focus-visible,
.rbc-switch input:focus-visible + .rbc-switch-track {
	outline: 2px solid var(--rbc-color-primary);
	outline-offset: 2px;
}

/* Panels */
.rbc-panel {
	animation: rbc-fade-in 220ms ease both;
}

/* Groups */
.rbc-group {
	margin-bottom: 1.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--rbc-color-border);
}

.rbc-group:last-of-type {
	border-bottom: none;
}

.rbc-group-inline {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.rbc-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--rbc-color-text);
}

.rbc-label-small {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--rbc-color-text-muted);
	margin-bottom: 0.35rem;
}

.rbc-input-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.rbc-input,
.rbc-select {
	width: 100%;
	background: var(--rbc-color-bg);
	border: 1px solid var(--rbc-color-border);
	border-radius: var(--rbc-radius-sm);
	padding: 0.65rem 0.8rem;
	transition: border-color var(--rbc-transition), box-shadow var(--rbc-transition);
}

.rbc-input:hover,
.rbc-select:hover {
	border-color: #c7cdd6;
}

.rbc-input:focus,
.rbc-select:focus {
	border-color: var(--rbc-color-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
	outline: none;
}

.rbc-input-percent {
	max-width: 7.5rem;
}

.rbc-select {
	max-width: 8rem;
	flex-shrink: 0;
	cursor: pointer;
}

.rbc-suffix {
	color: var(--rbc-color-text-muted);
	font-size: 0.9rem;
	flex-shrink: 0;
}

/* Rabatt-Zeilen */
.rbc-discount-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.rbc-discount-row {
	animation: rbc-fade-in 200ms ease both;
}

.rbc-icon-btn {
	appearance: none;
	background: var(--rbc-color-surface);
	border: 1px solid var(--rbc-color-border);
	color: var(--rbc-color-text-muted);
	border-radius: var(--rbc-radius-sm);
	width: 2.25rem;
	height: 2.25rem;
	flex-shrink: 0;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--rbc-transition), color var(--rbc-transition), transform var(--rbc-transition);
}

.rbc-icon-btn:hover {
	background: #fee2e2;
	color: #b91c1c;
	border-color: #fecaca;
}

.rbc-icon-btn:active {
	transform: scale(0.94);
}

/* Buttons */
.rbc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: var(--rbc-radius-sm);
	font-weight: 600;
	font-size: 0.9rem;
	padding: 0.7rem 1.1rem;
	cursor: pointer;
	transition: background-color var(--rbc-transition), border-color var(--rbc-transition), transform var(--rbc-transition), box-shadow var(--rbc-transition);
}

.rbc-btn:active {
	transform: translateY(1px);
}

.rbc-btn-small {
	padding: 0.5rem 0.85rem;
	font-size: 0.82rem;
}

.rbc-btn-primary {
	background: var(--rbc-color-primary);
	color: var(--rbc-color-primary-contrast);
}

.rbc-btn-primary:hover {
	background: var(--rbc-color-primary-hover);
}

.rbc-btn-secondary {
	background: var(--rbc-color-surface);
	border-color: var(--rbc-color-border);
	color: var(--rbc-color-text);
}

.rbc-btn-secondary:hover {
	background: #eef0f3;
}

.rbc-btn-ghost {
	background: transparent;
	border-color: var(--rbc-color-border);
	color: var(--rbc-color-text-muted);
}

.rbc-btn-ghost:hover {
	background: var(--rbc-color-surface);
	color: var(--rbc-color-text);
}

/* Switch (MwSt.-Toggle) */
.rbc-switch {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
	user-select: none;
	font-size: 0.9rem;
	font-weight: 500;
}

.rbc-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.rbc-switch-track {
	position: relative;
	width: 2.5rem;
	height: 1.4rem;
	background: #d1d5db;
	border-radius: 999px;
	transition: background-color var(--rbc-transition);
	flex-shrink: 0;
}

.rbc-switch-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 1.15rem;
	height: 1.15rem;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform var(--rbc-transition);
}

.rbc-switch input:checked + .rbc-switch-track {
	background: var(--rbc-color-primary);
}

.rbc-switch input:checked + .rbc-switch-track .rbc-switch-thumb {
	transform: translateX(1.1rem);
}

.rbc-vat-rate-row {
	max-width: 10rem;
}

/* Trenner */
.rbc-divider {
	height: 1px;
	background: var(--rbc-color-border);
	margin: 1.25rem 0;
	border: none;
}

/* Ergebnisse */
.rbc-results {
	/* background: var(--rbc-color-surface); */
	border: 1px solid var(--rbc-color-border);
	border-radius: var(--rbc-radius-md);
	padding: 1rem 1.1rem;
	margin-bottom: 1.25rem;
}

.rbc-result-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.45rem 0;
}

.rbc-result-row + .rbc-result-row {
	border-top: 1px dashed var(--rbc-color-border);
}

.rbc-result-label {
	color: var(--rbc-color-text-muted);
	font-size: 0.85rem;
}

.rbc-result-value {
	font-weight: 700;
	font-size: 1rem;
	transition: color var(--rbc-transition);
}

.rbc-result-value-large {
	font-size: 1.35rem;
}

.rbc-result-row-highlight {
	background: var(--rbc-color-success-bg);
	margin: 0.35rem -1.1rem -1.1rem;
	padding: 0.75rem 1.1rem;
	border-radius: 0 0 var(--rbc-radius-md) var(--rbc-radius-md);
	border-top: 1px solid #dcfce7 !important;
}

.rbc-result-row-highlight .rbc-result-value {
	color: var(--rbc-color-success);
}

.rbc-result-value.is-updated {
	animation: rbc-pulse 380ms ease;
}

@keyframes rbc-pulse {
	0% {
		transform: scale(1);
	}
	40% {
		transform: scale(1.06);
	}
	100% {
		transform: scale(1);
	}
}

/* Aktionen */
.rbc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.rbc-actions .rbc-btn {
	flex: 1 1 auto;
}

.rbc-btn-02{
	color: #fff !important;
}

/* Toast-Hinweis */
.rbc-toast {
	margin: 0.75rem 0 0;
	font-size: 0.8rem;
	color: var(--rbc-color-success);
	text-align: center;
	min-height: 1.1em;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity var(--rbc-transition), transform var(--rbc-transition);
}

.rbc-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.rbc-toast.is-error {
	color: #b91c1c;
}

/* Responsive Anpassungen */
@media (max-width: 480px) {
	.rbc-card {
		padding: 1.25rem;
		border-radius: var(--rbc-radius-md);
	}

	.rbc-title {
		font-size: 1.2rem;
	}

	.rbc-input-percent {
		max-width: 5.5rem;
	}

	.rbc-select {
		max-width: 6.5rem;
	}

	.rbc-actions {
		flex-direction: column;
	}
}

/* Bewegungen reduzieren, wenn vom Nutzer gewünscht */
@media (prefers-reduced-motion: reduce) {
	.rbc-app * {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
