/**
 * Payment shock calculator.
 *
 * THE ONE THING THE LAYOUT HAS TO DO
 * ----------------------------------
 * Put the two payments side by side, large, with the arrow between them. The
 * entire point of the tool is a comparison of two numbers, and a reader should
 * get it before reading a word. Everything else on the page is support.
 *
 * On a narrow screen the pair stacks and the arrow turns to point down, because
 * a horizontal arrow between vertically stacked figures reads as a mistake.
 *
 * The "after" figure is emphasized but not alarmed. It is not red, it does not
 * shout, and it carries no warning icon. A payment increase that was in the
 * contract all along is not a scandal, and dressing it as one would make the
 * tool feel like it wants something from the reader.
 *
 * @package EquityBankLoan\Core
 */

.ebl-shock {
	--ebl-ink: #16202c;
	--ebl-ink-soft: #55636f;
	--ebl-line: #d7dee5;
	--ebl-line-faint: #eef2f6;
	--ebl-accent: #10416b;
	--ebl-surface-alt: #f4f7fa;
	--ebl-after: #7a4a12;
	--ebl-after-bg: #fbf4ea;

	color: var(--ebl-ink);
}

/* Form ----------------------------------------------------------------- */

.ebl-shock__form {
	background: var(--ebl-surface-alt);
	border: 1px solid var(--ebl-line);
	border-radius: 6px;
	margin: 0 0 1.5em;
	padding: 1.25em;
}

.ebl-shock__fields {
	display: grid;
	gap: 1em;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.ebl-shock__field {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.ebl-shock__field label {
	font-size: 0.9em;
	font-weight: 600;
	margin-bottom: 0.35em;
}

.ebl-shock__field input {
	border: 1px solid var(--ebl-line);
	border-radius: 4px;
	font-size: 1em;
	padding: 0.5em 0.6em;
	width: 100%;
}

.ebl-shock__hint {
	color: var(--ebl-ink-soft);
	font-size: 0.8em;
	line-height: 1.45;
	margin-top: 0.35em;
}

.ebl-shock__submit {
	margin: 1.2em 0 0;
}

.ebl-shock__submit button {
	background: var(--ebl-accent);
	border: 0;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	font-size: 1em;
	padding: 0.6em 1.4em;
}

/* Errors --------------------------------------------------------------- */

.ebl-shock__errors {
	border-left: 3px solid var(--ebl-after);
	background: var(--ebl-after-bg);
	list-style: none;
	margin: 0 0 1.5em;
	padding: 0.9em 1em 0.9em 1.1em;
}

.ebl-shock__errors li + li {
	margin-top: 0.4em;
}

/* The headline pair ----------------------------------------------------- */

.ebl-shock__headline {
	align-items: stretch;
	display: grid;
	gap: 0.75em;
	grid-template-columns: 1fr auto 1fr;
	margin: 0 0 1.1em;
}

.ebl-shock__figure {
	border: 1px solid var(--ebl-line);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 1.1em 1.2em;
}

.ebl-shock__figure--after {
	background: var(--ebl-after-bg);
	border-color: var(--ebl-after);
}

.ebl-shock__figure-label {
	color: var(--ebl-ink-soft);
	font-size: 0.85em;
	line-height: 1.4;
}

.ebl-shock__figure-value {
	font-size: 2em;
	line-height: 1.15;
	margin: 0.15em 0 0;
}

.ebl-shock__figure--after .ebl-shock__figure-value {
	color: var(--ebl-after);
}

.ebl-shock__figure-note {
	color: var(--ebl-ink-soft);
	font-size: 0.85em;
}

.ebl-shock__arrow {
	align-self: center;
	color: var(--ebl-ink-soft);
	font-size: 1.6em;
	line-height: 1;
}

.ebl-shock__delta {
	font-size: 1.1em;
	font-weight: 600;
	margin: 0 0 0.8em;
}

.ebl-shock__notice {
	background: var(--ebl-surface-alt);
	border-left: 3px solid var(--ebl-line);
	margin: 0 0 0.8em;
	padding: 0.7em 0.9em;
}

.ebl-shock__secondary {
	color: var(--ebl-ink-soft);
	font-size: 0.9em;
	line-height: 1.55;
	margin: 0 0 0.8em;
}

.ebl-shock__subhead {
	font-size: 1.15em;
	margin: 1.6em 0 0.5em;
}

/* Stress table ---------------------------------------------------------- */

.ebl-shock__tablewrap {
	overflow-x: auto;
}

.ebl-shock__table {
	border-collapse: collapse;
	font-size: 0.92em;
	margin: 0.6em 0 0;
	min-width: 100%;
	width: 100%;
}

.ebl-shock__table th,
.ebl-shock__table td {
	border-bottom: 1px solid var(--ebl-line-faint);
	padding: 0.6em 0.7em;
	text-align: left;
	white-space: nowrap;
}

.ebl-shock__table thead th {
	color: var(--ebl-ink-soft);
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: normal;
}

/* The reader's own rate. Marked so the rest of the table reads as
   hypothetical against a row they recognize. */

.ebl-shock__row--yours {
	background: var(--ebl-surface-alt);
	font-weight: 600;
}

/* Assumptions ----------------------------------------------------------- */

.ebl-shock__assumptions {
	border-top: 1px solid var(--ebl-line-faint);
	margin-top: 1.8em;
	padding-top: 0.6em;
}

.ebl-shock__assumptions ul {
	margin: 0 0 1em;
	padding-left: 1.2em;
}

.ebl-shock__assumptions li {
	line-height: 1.55;
	margin-bottom: 0.5em;
}

/* Narrow screens -------------------------------------------------------- */

@media (max-width: 600px) {

	.ebl-shock__headline {
		grid-template-columns: 1fr;
	}

	.ebl-shock__arrow {
		justify-self: center;
		transform: rotate(90deg);
	}

	.ebl-shock__figure-value {
		font-size: 1.7em;
	}
}
