/**
 * WSR Investment Rewards — flexible savings.
 *
 * Savings cards are deliberately distinct from fixed-plan cards: a range rather
 * than a single price, a percentage rather than a cash amount per day. The two
 * categories are different products and should not look interchangeable.
 */

.wsr-savings {
	--wsr-sv-accent: #16663f;
	--wsr-sv-accent-bg: #edf7f1;
	margin-bottom: 20px;
}

.wsr-savings__grid {
	display: grid;
	grid-template-columns: repeat( var(--wsr-plan-columns, 3), minmax( 0, 1fr ) );
	gap: 16px;
}

.wsr-savings-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 20px;
	background: var(--wsr-surface, #fff);
	border: 1px solid var(--wsr-line, #dcdcde);
	border-top: 4px solid var(--wsr-sv-accent);
	border-radius: var(--wsr-radius, 12px);
}

.wsr-savings-card--featured {
	box-shadow: 0 4px 16px rgba( 22, 102, 63, .12 );
}

.wsr-savings-card__venture {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--wsr-sv-accent);
}

.wsr-savings-card__name {
	margin: 0;
	font-size: 18px;
	color: var(--wsr-ink, #1d2327);
}

.wsr-savings-card__range {
	padding: 14px;
	background: var(--wsr-sv-accent-bg);
	border-radius: 8px;
}

.wsr-savings-card__range-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	font-weight: 600;
	color: var(--wsr-muted, #646970);
	margin-bottom: 3px;
}

.wsr-savings-card__range-value {
	display: block;
	font-size: 18px;
	font-weight: 700;
	color: var(--wsr-sv-accent);
	font-variant-numeric: tabular-nums;
}

.wsr-savings-card__terms {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 14px;
	margin: 0;
	padding: 12px 0;
	border-bottom: 1px solid var(--wsr-line, #dcdcde);
}

.wsr-savings-card__terms dt {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	font-weight: 600;
	color: var(--wsr-muted, #646970);
}

.wsr-savings-card__terms dd {
	margin: 2px 0 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--wsr-ink, #1d2327);
	font-variant-numeric: tabular-nums;
}

.wsr-savings-card__description,
.wsr-savings-card__note {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--wsr-muted, #646970);
}

.wsr-savings-card .wsr-btn {
	width: 100%;
	margin-top: auto;
}

.wsr-savings-dash .wsr-dash__primary {
	background: var(--wsr-sv-accent-bg, #edf7f1);
}

/* Modal ------------------------------------------------------------------- */

.wsr-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wsr-modal[hidden] {
	display: none;
}

.wsr-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, .5 );
}

.wsr-modal__panel {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba( 0, 0, 0, .28 );
}

.wsr-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 34px;
	height: 34px;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: var(--wsr-muted, #646970);
	cursor: pointer;
	border-radius: 8px;
}

.wsr-modal__close:hover {
	background: #f0f0f1;
}

.wsr-modal__title {
	margin: 0 0 16px;
	font-size: 19px;
	padding-right: 30px;
	color: var(--wsr-ink, #1d2327);
}

.wsr-modal__panel label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
}

.wsr-modal__field {
	display: flex;
	margin-bottom: 6px;
}

.wsr-modal__prefix {
	display: flex;
	align-items: center;
	padding: 0 13px;
	background: #f6f7f7;
	border: 1px solid var(--wsr-line, #dcdcde);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	font-weight: 600;
	color: var(--wsr-muted, #646970);
}

.wsr-modal__field input {
	flex: 1;
	min-width: 0;
	padding: 13px;
	border: 1px solid var(--wsr-line, #dcdcde);
	border-radius: 0 8px 8px 0;
	font-size: 20px;
	font-variant-numeric: tabular-nums;
}

.wsr-modal__field input:focus {
	outline: 2px solid rgba( 22, 102, 63, .35 );
	outline-offset: 1px;
}

.wsr-modal__hint,
.wsr-modal__note {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--wsr-muted, #646970);
}

.wsr-modal__note {
	margin: 12px 0 0;
	text-align: center;
}

.wsr-modal__quote {
	margin: 0 0 14px;
	padding: 16px;
	background: #f6f7f7;
	border-radius: 10px;
}

.wsr-modal__quote div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 7px 0;
}

.wsr-modal__quote dt {
	font-size: 13px;
	color: var(--wsr-muted, #646970);
}

.wsr-modal__quote dd {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--wsr-ink, #1d2327);
}

.wsr-modal__quote-total {
	border-top: 1px solid var(--wsr-line, #dcdcde);
	margin-top: 4px;
	padding-top: 10px !important;
}

.wsr-modal__quote-total dd {
	font-size: 19px;
	color: var(--wsr-sv-accent, #16663f);
}

.wsr-modal__result {
	min-height: 18px;
	margin: 0 0 12px;
	font-size: 13px;
}

.wsr-modal__result.is-error {
	color: #8a2c2c;
}

.wsr-modal__result.is-success {
	color: #16663f;
	font-weight: 600;
}

.wsr-modal__confirm {
	width: 100%;
}

@media (max-width: 782px) {
	.wsr-savings__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.wsr-modal {
		padding: 0;
		align-items: flex-end;
	}

	.wsr-modal__panel {
		max-width: 100%;
		max-height: 92vh;
		border-radius: 14px 14px 0 0;
	}
}
