/**
 * WebStudio Finance Calculator
 */

.wsfc-calculator {
	--wsfc-radius: 12px;
	--wsfc-radius-sm: 8px;
	--wsfc-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
	--wsfc-shadow-hover: 0 8px 32px rgba(15, 23, 42, 0.12);
	--wsfc-border: rgba(15, 23, 42, 0.08);
	--wsfc-text: #0f172a;
	--wsfc-text-muted: #64748b;
	--wsfc-bg: #ffffff;
	--wsfc-bg-subtle: #f8fafc;
	--wsfc-accent: currentColor;
	--wsfc-transition: 0.2s ease;
	font-family: inherit;
	color: var(--wsfc-text);
	line-height: 1.5;
}

.wsfc-calculator *,
.wsfc-calculator *::before,
.wsfc-calculator *::after {
	box-sizing: border-box;
}

/* Controls */
.wsfc-controls {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding: 1.25rem;
	background: var(--wsfc-bg);
	border-radius: var(--wsfc-radius);
	box-shadow: var(--wsfc-shadow);
	border: 1px solid var(--wsfc-border);
}

.wsfc-control {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.wsfc-control label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wsfc-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wsfc-control select,
.wsfc-control input[type="number"],
.wsfc-control input[type="text"] {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	font-family: inherit;
	color: var(--wsfc-text);
	background: var(--wsfc-bg-subtle);
	border: 1px solid var(--wsfc-border);
	border-radius: var(--wsfc-radius-sm);
	transition: border-color var(--wsfc-transition), box-shadow var(--wsfc-transition);
	appearance: none;
}

.wsfc-control select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	padding-right: 2.5rem;
	cursor: pointer;
}

.wsfc-control--hidden {
	display: none;
}

.wsfc-control select:focus,
.wsfc-control input:focus {
	outline: none;
	border-color: var(--wsfc-accent);
	box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.wsfc-deposit-toggle {
	display: flex;
	width: 100%;
	padding: 4px;
	margin-bottom: 0.5rem;
	background: var(--wsfc-bg-subtle);
	border: 1px solid var(--wsfc-border);
	border-radius: var(--wsfc-radius-sm);
	gap: 0;
}

.wsfc-deposit-toggle button {
	flex: 1 1 0;
	min-width: 0;
	padding: 0.5625rem 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	color: var(--wsfc-text-muted);
	background: transparent;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: color var(--wsfc-transition), background var(--wsfc-transition), box-shadow var(--wsfc-transition);
	white-space: nowrap;
}

.wsfc-deposit-toggle button:hover:not(.is-active) {
	color: var(--wsfc-text);
	background: rgba(15, 23, 42, 0.04);
}

.wsfc-deposit-toggle button.is-active {
	color: var(--wsfc-text);
	background: var(--wsfc-bg);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
}

.wsfc-deposit-toggle button:focus-visible {
	outline: 2px solid var(--wsfc-accent);
	outline-offset: 1px;
}

.wsfc-deposit-field {
	display: flex;
	align-items: center;
	width: 100%;
	background: var(--wsfc-bg-subtle);
	border: 1px solid var(--wsfc-border);
	border-radius: var(--wsfc-radius-sm);
	transition: border-color var(--wsfc-transition), box-shadow var(--wsfc-transition);
}

.wsfc-deposit-field:focus-within {
	border-color: var(--wsfc-accent);
	box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.wsfc-deposit-affix {
	display: none;
	flex-shrink: 0;
	padding: 0.75rem 0.875rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--wsfc-text-muted);
	background: rgba(15, 23, 42, 0.04);
	border-right: 1px solid var(--wsfc-border);
}

.wsfc-deposit-affix--suffix {
	border-right: none;
	border-left: 1px solid var(--wsfc-border);
}

.wsfc-deposit-affix.is-visible {
	display: block;
}

.wsfc-deposit-field input[type="number"] {
	flex: 1;
	min-width: 0;
	width: auto;
	padding: 0.75rem 1rem;
	border: none;
	background: transparent;
	border-radius: 0;
	box-shadow: none;
}

.wsfc-deposit-field input[type="number"]:focus {
	box-shadow: none;
}

.wsfc-control--deposit {
	min-width: 0;
}

.wsfc-price-display {
	padding: 0.75rem 1rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--wsfc-text);
	background: var(--wsfc-bg-subtle);
	border-radius: var(--wsfc-radius-sm);
	border: 1px solid var(--wsfc-border);
}

/* Panels */
.wsfc-panels {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

.wsfc-panels:has(.wsfc-panel:only-child) {
	grid-template-columns: 1fr;
	max-width: 640px;
}

.wsfc-panel {
	background: var(--wsfc-bg);
	border-radius: var(--wsfc-radius);
	box-shadow: var(--wsfc-shadow);
	border: 1px solid var(--wsfc-border);
	overflow: hidden;
	transition: box-shadow var(--wsfc-transition);
}

.wsfc-panel:hover {
	box-shadow: var(--wsfc-shadow-hover);
}

.wsfc-panel-header {
	padding: 1.5rem 1.5rem 1rem;
	border-bottom: 1px solid var(--wsfc-border);
}

.wsfc-panel-badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wsfc-bg);
	background: var(--wsfc-accent);
	border-radius: 999px;
	margin-bottom: 0.5rem;
}

.wsfc-panel-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wsfc-text);
}

.wsfc-panel-body {
	padding: 1.5rem;
}

.wsfc-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--wsfc-border);
	gap: 1rem;
}

.wsfc-row:last-child {
	border-bottom: none;
}

.wsfc-row-label {
	font-size: 0.9375rem;
	color: var(--wsfc-text-muted);
	flex-shrink: 0;
}

.wsfc-row-value {
	font-size: 1rem;
	font-weight: 600;
	color: var(--wsfc-text);
	text-align: right;
}

.wsfc-row--highlight .wsfc-row-value {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wsfc-accent);
}

/* Accordion */
.wsfc-accordion {
	border-top: 1px solid var(--wsfc-border);
}

.wsfc-accordion-trigger {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	padding: 1rem 1.5rem;
	font-size: 0.9375rem;
	font-weight: 600;
	font-family: inherit;
	color: var(--wsfc-text);
	background: var(--wsfc-bg-subtle);
	border: none;
	cursor: pointer;
	text-align: left;
	transition: background var(--wsfc-transition);
}

.wsfc-accordion-trigger:hover {
	background: rgba(15, 23, 42, 0.04);
}

.wsfc-accordion-icon {
	width: 1rem;
	height: 1rem;
	transition: transform var(--wsfc-transition);
}

.wsfc-accordion-trigger[aria-expanded="true"] .wsfc-accordion-icon {
	transform: rotate(180deg);
}

.wsfc-accordion-content {
	padding: 0 1.5rem;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, padding 0.3s ease;
}

.wsfc-accordion-content.is-open {
	padding: 0 1.5rem 1.25rem;
	max-height: 200px;
}

.wsfc-accordion-content p {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--wsfc-text-muted);
	line-height: 1.6;
}

/* Disclaimer */
.wsfc-disclaimer {
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.5rem;
	background: var(--wsfc-bg-subtle);
	border-radius: var(--wsfc-radius);
	border: 1px solid var(--wsfc-border);
}

.wsfc-disclaimer h3 {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--wsfc-text);
}

.wsfc-disclaimer p {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--wsfc-text-muted);
	line-height: 1.6;
}

/* Buttons */
.wsfc-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.wsfc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.875rem 1.75rem;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	text-decoration: none;
	border-radius: var(--wsfc-radius-sm);
	cursor: pointer;
	transition: all var(--wsfc-transition);
	border: 2px solid transparent;
}

.wsfc-btn--primary {
	color: var(--wsfc-bg);
	background: var(--wsfc-accent);
	border-color: var(--wsfc-accent);
}

.wsfc-btn--primary:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.wsfc-btn--secondary {
	color: var(--wsfc-accent);
	background: transparent;
	border-color: var(--wsfc-accent);
}

.wsfc-btn--secondary:hover {
	background: rgba(15, 23, 42, 0.04);
}

/* Notice */
.wsfc-notice {
	padding: 1.5rem;
	text-align: center;
	color: var(--wsfc-text-muted);
	background: var(--wsfc-bg-subtle);
	border-radius: var(--wsfc-radius);
	border: 1px dashed var(--wsfc-border);
}

/* Responsive */
@media (max-width: 1024px) {
	.wsfc-controls {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.wsfc-controls {
		grid-template-columns: 1fr;
	}

	.wsfc-deposit-toggle button {
		font-size: 0.75rem;
		padding: 0.5rem 0.375rem;
	}

	.wsfc-panels {
		grid-template-columns: 1fr;
	}

	.wsfc-buttons {
		flex-direction: column;
	}

	.wsfc-btn {
		width: 100%;
	}
}

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