/*
 * Avanta 3:12-kalkylator — stilmall
 * Färger och typsnitt hämtade från Avantas grafiska profil (avanta-ekonomi theme.json):
 *   --a312-base-1:      #112967  (marinblå, primär)
 *   --a312-base-2:      #132E72  (mörkare marinblå)
 *   --a312-base-3:      #FFE7AA  (guld/beige, accent)
 *   --a312-base-3-100:  #FFEFC4
 *   --a312-base-3-200:  #FFF7E5
 *   --a312-neutral-1:   #949494
 *   --a312-neutral-2:   #CCCCCC
 *   --a312-neutral-3:   #F4F4F4
 *   Typsnitt: "Noto Sans", sans-serif
 */

.a312-calculator {
	--a312-base-1: #112967;
	--a312-base-2: #132E72;
	--a312-base-3: #FFE7AA;
	--a312-base-3-100: #FFEFC4;
	--a312-base-3-200: #FFF7E5;
	--a312-neutral-1: #656565;
	--a312-neutral-2: #CCCCCC;
	--a312-neutral-3: #F4F4F4;
	--a312-white: #FFFFFF;
	--a312-black: #070707;
	--a312-radius: 6px;

	font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--a312-black);
	max-width: 720px;
	margin: 0 auto;
	box-sizing: border-box;
}

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

/* ---------- Sektioner (accordion) ---------- */

.a312-calculator [hidden] {
	display: none !important;
}

.a312-section {
	background: var(--a312-base-3-200);
	border: 1px solid var(--a312-base-3-100);
	border-radius: var(--a312-radius);
	margin-bottom: 12px;
	overflow: hidden;
}

.a312-section__header {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
	background: transparent;
	border: 0;
	padding: 16px 20px;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}

.a312-section__title {
	font-weight: 600;
	font-size: 16px;
	color: var(--a312-base-1);
}

.a312-section__value {
	margin-left: auto;
	color: var(--a312-base-1);
	font-weight: 600;
	font-size: 15px;
}

.a312-section__chevron {
	font-size: 20px;
	line-height: 1;
	color: var(--a312-base-1);
	width: 20px;
	text-align: center;
	flex-shrink: 0;
}

.a312-section__body {
	padding: 4px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.a312-section:not(.a312-section--open) .a312-section__body {
	display: none;
}

.a312-section__body--text {
	display: block;
	font-size: 14px;
	line-height: 1.6;
	color: #313131;
}

.a312-section__body--text p {
	margin: 0 0 14px;
}

.a312-section__body--text hr {
	border: none;
	border-top: 1px solid var(--a312-neutral-2);
	margin: 16px 0;
}

.a312-calc-details__disclaimer {
	font-size: 12px;
	color: var(--a312-neutral-1);
}

/* ---------- Fält ---------- */

.a312-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.a312-field--checkbox {
	flex-direction: row;
	align-items: center;
	gap: 10px;
}

.a312-field--checkbox input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--a312-base-1);
	background-color: white;
}

.a312-field--checkbox input[type="checkbox"]:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.a312-field--disabled {
	opacity: 0.6;
}

.a312-field__label {
	font-weight: 600;
	font-size: 14px;
	color: var(--a312-black);
}

.a312-field__help {
	font-size: 12px;
	color: var(--a312-neutral-1);
	line-height: 1.5;
}

.a312-input {
	font-family: inherit;
	font-size: 15px;
	padding: 10px 12px;
	border: 1px solid var(--a312-neutral-2);
	border-radius: 3px;
	background: var(--a312-white);
	color: var(--a312-black);
	width: 100%;
}

.a312-input:focus {
	outline: 2px solid var(--a312-base-1);
	outline-offset: 1px;
}

.a312-input--select {
	appearance: auto;
}

.a312-input[disabled] {
	opacity: 0.7;
	cursor: not-allowed;
}

.a312-field--maka {
	padding: 12px 14px;
	background: var(--a312-base-3-100);
	border-radius: var(--a312-radius);
}

/* ---------- Knappar ---------- */

.a312-btn {
	font-family: inherit;
	font-weight: 600;
	font-size: 15px;
	padding: 12px 24px;
	border-radius: 3px;
	border: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.a312-btn:hover {
	opacity: 0.9;
}

.a312-btn--primary {
	background: var(--a312-base-1);
	color: var(--a312-white);
}

.a312-btn--cta {
	background: #ff6900;
	color: var(--a312-white);
}

.a312-foretag__actions {
	display: flex;
	justify-content: flex-end;
}

/* ---------- Resultat ---------- */

.a312-result {
	background: var(--a312-base-3-200);
	border: 1px solid var(--a312-base-3-100);
	border-radius: var(--a312-radius);
	padding: 20px;
	margin-bottom: 16px;
}

.a312-result__headline {
	font-size: 15px;
	color: var(--a312-black);
	margin-bottom: 6px;
}

.a312-result__amount {
	font-size: 30px;
	font-weight: 700;
	color: var(--a312-base-1);
}

.a312-result__note {
	font-size: 12px;
	color: var(--a312-neutral-1);
	margin-top: 4px;
}

/* ---------- E-post ---------- */

.a312-email {
	background: var(--a312-neutral-3);
	border-radius: var(--a312-radius);
	padding: 20px;
	margin-bottom: 20px;
}

.a312-email__title {
	font-weight: 600;
	margin-bottom: 10px;
}

.a312-email__row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.a312-email__row .a312-input {
	flex: 1 1 240px;
}

.a312-email__consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13px;
	color: #313131;
}

.a312-email__consent a {
	color: #cf2e2e;
}

.a312-email__consent + .a312-email__consent {
	margin-top: 8px;
}

.a312-email__actions {
	margin-top: 16px;
}

.a312-email__status {
	margin-top: 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.a312-email__status:empty {
	display: none;
}

.a312-email__status--ok,
.a312-email__status--error {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-radius: var(--a312-radius);
	border: 2px solid;
}

.a312-email__status--ok {
	color: #0b5a3c;
	background: #e6faf2;
	border-color: #00d084;
}

.a312-email__status--error {
	color: #8f1f1f;
	background: #fdecec;
	border-color: #cf2e2e;
}

.a312-email__status--ok::before,
.a312-email__status--error::before {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.a312-email__status--ok::before {
	content: "\2713";
	background: #00a468;
}

.a312-email__status--error::before {
	content: "!";
	background: #cf2e2e;
}

/* ---------- Detaljerad uträkning ---------- */

.a312-calc-details {
	background: var(--a312-white);
	border: 1px solid var(--a312-neutral-2);
	border-radius: var(--a312-radius);
	padding: 24px;
	margin-bottom: 16px;
}

.a312-calc-details__title {
	font-size: 20px;
	margin: 0 0 16px;
	color: var(--a312-base-1);
}

.a312-company-result {
	margin-bottom: 20px;
}

.a312-company-result__name {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 10px;
	color: var(--a312-black);
}

.a312-company-result__warning {
	background: #fdd79a;
	border: 1px solid #ffb32d;
	border-radius: var(--a312-radius);
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.5;
	color: #313131;
	margin-bottom: 14px;
}

.a312-company-result__row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
	border-bottom: 1px solid var(--a312-neutral-3);
}

.a312-company-result__row--total {
	font-weight: 700;
	border-bottom: none;
	border-top: 1px solid var(--a312-neutral-2);
	margin-top: 4px;
	padding-top: 10px;
}

/* ---------- Responsivt ---------- */

@media (max-width: 480px) {
	.a312-section__header {
		padding: 14px 16px;
	}

	.a312-section__body {
		padding: 4px 16px 16px;
	}

	.a312-result__amount {
		font-size: 24px;
	}
}
