/**
 * Pest Tech Research — Missed Call Revenue Calculator Styles
 *
 * @package PTR_Research
 */

.ptr-calc-container {
	margin: 2rem 0 3rem;
	font-family: inherit;
	color: #1e293b;
}

.ptr-calc-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	overflow: hidden;
}

.ptr-calc-header {
	padding: 1.5rem 1.75rem;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

.ptr-calc-title {
	margin: 0 0 0.5rem 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}

.ptr-calc-subtitle {
	margin: 0;
	font-size: 0.925rem;
	color: #64748b;
	line-height: 1.5;
}

.ptr-calc-body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	padding: 1.75rem;
}

@media (min-width: 900px) {
	.ptr-calc-body {
		grid-template-columns: 1.15fr 0.95fr;
		gap: 2.5rem;
		align-items: start;
	}
}

/* Form Controls */
.ptr-calc-form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.ptr-calc-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ptr-calc-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.4;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.ptr-calc-help {
	font-size: 0.825rem;
	color: #64748b;
	line-height: 1.45;
	margin: 0;
}

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

.ptr-input-prefix,
.ptr-input-suffix {
	position: absolute;
	color: #64748b;
	font-weight: 500;
	font-size: 0.95rem;
	pointer-events: none;
	user-select: none;
}

.ptr-input-prefix {
	left: 0.875rem;
}

.ptr-input-suffix {
	right: 0.875rem;
}

.ptr-calc-input {
	width: 100%;
	padding: 0.65rem 0.875rem;
	font-size: 1rem;
	font-weight: 600;
	color: #0f172a;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: textfield;
	-moz-appearance: textfield;
}

.ptr-input-wrapper--prefix .ptr-calc-input {
	padding-left: 2rem;
}

.ptr-input-wrapper--suffix .ptr-calc-input {
	padding-right: 2rem;
}

.ptr-calc-input:focus {
	outline: none;
	border-color: var(--ptr-ochre, #b45309);
	box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.ptr-calc-input::-webkit-outer-spin-button,
.ptr-calc-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Range Sliders */
.ptr-range-wrapper {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 0.25rem;
}

.ptr-calc-range {
	flex: 1;
	height: 6px;
	background: #e2e8f0;
	border-radius: 3px;
	outline: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ptr-calc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--ptr-ochre, #b45309);
	border: 2px solid #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	transition: transform 0.1s ease;
}

.ptr-calc-range::-webkit-slider-thumb:hover {
	transform: scale(1.15);
}

.ptr-calc-range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--ptr-ochre, #b45309);
	border: 2px solid #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

/* Results Panel */
.ptr-calc-results {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

@media (min-width: 900px) {
	.ptr-calc-results {
		position: sticky;
		top: 2rem;
	}
}

.ptr-results-header {
	border-bottom: 1px solid #e2e8f0;
	padding-bottom: 0.75rem;
}

.ptr-results-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: #0f172a;
}

.ptr-results-note {
	margin: 0.25rem 0 0 0;
	font-size: 0.8rem;
	color: #64748b;
}

/* Primary Metric Highlight Cards */
.ptr-metric-card {
	padding: 1.25rem;
	border-radius: 6px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
}

.ptr-metric-card--primary {
	background: var(--ptr-color-primary, #0f2942);
	color: #ffffff;
	border-color: var(--ptr-color-primary, #0f2942);
}

.ptr-metric-card--primary .ptr-metric-label {
	color: #94a3b8;
}

.ptr-metric-card--primary .ptr-metric-value {
	color: var(--ptr-ochre-light, #fde68a);
}

.ptr-metric-card--annual {
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.ptr-metric-card--annual .ptr-metric-label {
	color: #166534;
}

.ptr-metric-card--annual .ptr-metric-value {
	color: #15803d;
}

.ptr-metric-label {
	font-size: 0.825rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #475569;
	margin-bottom: 0.35rem;
}

.ptr-metric-value {
	font-size: 1.85rem;
	font-weight: 800;
	line-height: 1.15;
	color: #0f172a;
	font-variant-numeric: tabular-nums;
}

.ptr-metric-value-unit {
	font-size: 0.95rem;
	font-weight: 500;
	opacity: 0.8;
}

/* Secondary Metric Breakdown List */
.ptr-breakdown-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	border-top: 1px solid #e2e8f0;
	padding-top: 1rem;
}

.ptr-breakdown-item {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.9rem;
	line-height: 1.4;
}

.ptr-breakdown-label {
	color: #475569;
}

.ptr-breakdown-val {
	font-weight: 700;
	color: #0f172a;
	text-align: right;
}

/* Formula Breakdown Accordion */
.ptr-formula-section {
	margin-top: 2rem;
	padding: 0 1.75rem;
}

.ptr-accordion {
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	overflow: hidden;
	background: #ffffff;
}

.ptr-accordion summary {
	padding: 1rem 1.25rem;
	font-weight: 600;
	font-size: 0.95rem;
	color: #0f172a;
	cursor: pointer;
	background: #f8fafc;
	user-select: none;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.ptr-accordion summary::-webkit-details-marker {
	display: none;
}

.ptr-accordion summary::after {
	content: '+';
	font-size: 1.25rem;
	font-weight: 400;
	color: #64748b;
}

.ptr-accordion[open] summary::after {
	content: '−';
}

.ptr-accordion-content {
	padding: 1.25rem;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: #334155;
}

.ptr-formula-step {
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px dashed #e2e8f0;
}

.ptr-formula-step:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.ptr-formula-step strong {
	color: #0f172a;
	display: block;
	margin-bottom: 0.2rem;
}

.ptr-formula-code {
	display: inline-block;
	background: #f1f5f9;
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.85rem;
	color: var(--ptr-navy, #0f2942);
	margin-top: 0.2rem;
}

/* Scenarios Table Section */
.ptr-scenarios-section {
	margin-top: 2rem;
	padding: 0 1.75rem;
}

.ptr-scenarios-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 0.25rem 0;
}

.ptr-scenarios-desc {
	font-size: 0.875rem;
	color: #64748b;
	margin: 0 0 1rem 0;
}

.ptr-table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
}

.ptr-scenarios-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	text-align: left;
	background: #ffffff;
	min-width: 480px;
}

.ptr-scenarios-table th,
.ptr-scenarios-table td {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid #e2e8f0;
}

.ptr-scenarios-table th {
	background: #f8fafc;
	font-weight: 600;
	color: #475569;
	font-size: 0.825rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ptr-scenarios-table tr:last-child td {
	border-bottom: none;
}

.ptr-scenarios-table td:nth-child(2),
.ptr-scenarios-table td:nth-child(3),
.ptr-scenarios-table td:nth-child(4) {
	text-align: right;
}

.ptr-scenarios-table th:nth-child(2),
.ptr-scenarios-table th:nth-child(3),
.ptr-scenarios-table th:nth-child(4) {
	text-align: right;
}

.ptr-scenario-name {
	font-weight: 600;
	color: #0f172a;
}

/* Disclaimer Callout */
.ptr-calc-disclaimer {
	margin: 2rem 1.75rem 1.75rem;
	padding: 1rem 1.25rem;
	background: #f8fafc;
	border-left: 4px solid #94a3b8;
	border-radius: 0 6px 6px 0;
	font-size: 0.825rem;
	color: #475569;
	line-height: 1.55;
}

.ptr-calc-disclaimer p {
	margin: 0;
}
