/* Jouwfamiliepost, stijl Magnoliatak. Tokens komen uit het design system "Jouwfamiliepost". */

@font-face { font-family: "Young Serif"; src: url("fonts/young-serif-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

.jfp-body, .jfp {
	--papier: #fffcfb;
	--magnolia-50: #fbf1f4;
	--magnolia-100: #f6e3e8;
	--magnolia-300: #e9bfcb;
	--hart: #7e2e4f;
	--hart-donker: #5e1f3a;
	--tak: #3b2b30;
	--tak-zacht: #6b5560;
	--lijn: #e7d2d9;
	--blad: #4d6847;
	--blad-50: #e6eee1;
	--honing: #7d5300;
	--honing-50: #f9efd9;
	--fout: #9e2b2b;
	--fout-50: #f8e4e4;
	--font-display: "Young Serif", Georgia, serif;
	--font-tekst: "Atkinson Hyperlegible", system-ui, sans-serif;
	--rond-veld: 10px;
	--rond-vlak: 18px;
	--rond-pil: 999px;
	--schaduw-kaart: 0 12px 32px rgba(94, 31, 58, .16), 0 2px 6px rgba(94, 31, 58, .08);
	--perforatie: radial-gradient(circle 5px at 8px 8px, #0000 98%, #000) -8px -8px / 16px 16px;
}

.jfp-body { margin: 0; background: var(--magnolia-50); }

.jfp {
	box-sizing: border-box;
	max-width: 560px;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	background: var(--magnolia-50);
	color: var(--tak);
	font-family: var(--font-tekst);
	font-size: 17px;
	line-height: 27px;
	-webkit-text-size-adjust: 100%;
}
.jfp *, .jfp *::before, .jfp *::after { box-sizing: border-box; }
.jfp [hidden] { display: none !important; }
.jfp p { margin: 0; }
.jfp a { color: var(--hart); }
.jfp a:hover { color: var(--hart-donker); }
.jfp :focus-visible { outline: 3px solid var(--magnolia-300); outline-offset: 2px; }
.jfp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kop en menu */
.jfp-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.jfp-wordmark { font-family: var(--font-display); font-size: 20px; line-height: 28px; color: var(--hart) !important; text-decoration: none; }
.jfp-avatar { width: 44px; height: 44px; border-radius: var(--rond-pil); background: var(--magnolia-300); color: var(--tak) !important; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; text-decoration: none; }
.jfp-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: 16px; text-decoration: none; }
.jfp-icon { flex: none; }

.jfp-main { flex: 1; display: flex; flex-direction: column; gap: 32px; padding: 20px 20px 40px; }

.jfp-tabbar {
	position: sticky; bottom: 0; z-index: 10;
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
	padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
	background: var(--papier); border-top: 1px solid var(--lijn);
}
.jfp-tabbar__item { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--rond-pil); color: var(--tak) !important; font-size: 15px; text-decoration: none; }
.jfp-tabbar__item.is-active { background: var(--magnolia-100); color: var(--hart) !important; font-weight: 700; }

/* Tekst */
.jfp-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 40px; }
.jfp-h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 28px; }
.jfp-lead { font-size: 19px; line-height: 30px; }
.jfp-muted { color: var(--tak-zacht); font-size: 15px; line-height: 23px; }

/* Vlakken en lijsten */
.jfp-section { display: flex; flex-direction: column; gap: 12px; }
.jfp-panel { background: var(--papier); border: 1px solid var(--lijn); border-radius: var(--rond-vlak); padding: 24px; }
.jfp-panel--warn { background: var(--honing-50); border-color: var(--honing-50); }
.jfp-next { display: flex; flex-direction: column; gap: 20px; }
.jfp-next__body { display: flex; gap: 20px; align-items: flex-start; }
.jfp-next__body > div { display: flex; flex-direction: column; gap: 6px; }

.jfp-rows { list-style: none; margin: 0; padding: 0; }
.jfp-rows li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--lijn); }
.jfp-rows li:last-child { border-bottom: 0; }
.jfp-rows__date { width: 56px; flex: none; color: var(--tak-zacht); font-size: 15px; }
.jfp-rows__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jfp-rows__action { flex: none; padding: 10px 0; font-weight: 700; font-size: 16px; }
.jfp-rows__amount { flex: none; font-variant-numeric: tabular-nums; }
.jfp .is-negative { color: var(--fout); }

.jfp-pot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--magnolia-100); border-radius: var(--rond-vlak); color: var(--tak) !important; text-decoration: none; }
.jfp-pot__name { display: flex; flex-direction: column; gap: 2px; }
.jfp-pot__name .jfp-tag { align-self: flex-start; }
.jfp-pot__amount { font-family: var(--font-display); font-size: 24px; line-height: 30px; white-space: nowrap; }

.jfp-tag { display: inline-block; flex: none; padding: 2px 12px; border-radius: var(--rond-pil); background: var(--magnolia-100); color: var(--tak); font-size: 14px; line-height: 21px; font-weight: 400; white-space: nowrap; }
.jfp-tag--ingepland, .jfp-tag--verzonden { background: var(--blad-50); color: var(--blad); }
.jfp-tag--wacht_op_betaling, .jfp-tag--wacht_op_pottegoed { background: var(--honing-50); color: var(--honing); }
.jfp-tag--mislukt { background: var(--fout-50); color: var(--fout); }
.jfp-tag--geannuleerd { color: var(--tak-zacht); }

.jfp-notice { padding: 14px 18px; border-radius: var(--rond-vlak); background: var(--magnolia-100); color: var(--tak); font-size: 16px; line-height: 24px; }
.jfp-notice.is-ok { background: var(--blad-50); color: var(--blad); }
.jfp-notice.is-warn { background: var(--honing-50); color: var(--honing); }
.jfp-notice.is-error { background: var(--fout-50); color: var(--fout); }
.jfp-notice a { color: inherit; font-weight: 700; }

.jfp-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 20px; row-gap: 10px; margin: 0; }
.jfp-facts dt { color: var(--tak-zacht); }
.jfp-facts dd { margin: 0; }

.jfp-details summary { cursor: pointer; color: var(--hart); font-weight: 700; font-size: 16px; padding: 10px 0; }
.jfp-details[open] summary { margin-bottom: 12px; }

/* Knoppen */
.jfp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 52px; padding: 0 24px; border: 2px solid var(--hart); border-radius: var(--rond-pil);
	background: var(--hart); color: var(--papier) !important;
	font-family: var(--font-tekst); font-weight: 700; font-size: 17px; line-height: 1.2;
	text-decoration: none; text-align: center; cursor: pointer;
}
.jfp-btn:hover { background: var(--hart-donker); border-color: var(--hart-donker); }
.jfp-btn:disabled { opacity: .5; cursor: not-allowed; }
.jfp-btn--block { width: 100%; }
.jfp-btn--big { min-height: 56px; font-size: 18px; }
.jfp-btn--ghost { background: transparent; color: var(--hart) !important; }
.jfp-btn--ghost:hover { background: var(--magnolia-100); border-color: var(--hart); }
.jfp-btn--small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.jfp-link { background: none; border: 0; padding: 6px 0; color: var(--hart); text-decoration: underline; font-family: inherit; font-size: 15px; cursor: pointer; }
.jfp-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.jfp-actions__main, .jfp-inline { margin: 0; display: inline; }

/* Formulieren */
.jfp-form { margin: 0; }
.jfp-stack { display: flex; flex-direction: column; gap: 20px; }
.jfp-field { display: flex; flex-direction: column; gap: 8px; margin: 0; font-weight: 700; font-size: 16px; line-height: 24px; }
.jfp-field input:not([type=file]), .jfp-field select, .jfp-field textarea, .jfp-copy {
	width: 100%; min-height: 52px; padding: 12px 16px;
	border: 1px solid var(--lijn); border-radius: var(--rond-veld); background: var(--papier); color: var(--tak);
	font-family: var(--font-tekst); font-weight: 400; font-size: 17px; line-height: 27px;
}
.jfp-field input:focus, .jfp-field select:focus, .jfp-field textarea:focus { outline: 3px solid var(--magnolia-300); outline-offset: 0; border-color: var(--hart); }
.jfp-field textarea { font-size: 19px; line-height: 30px; resize: vertical; }
.jfp-field input[type=file] { font-weight: 400; font-size: 16px; }
.jfp-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; }
.jfp-check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.jfp-check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--hart); flex: none; }
.jfp-copy { font-size: 15px; }

.jfp-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.jfp-fieldset legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 16px; line-height: 24px; }
.jfp-fieldset .jfp-muted { margin-top: 10px; }

.jfp-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.jfp-option { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--lijn); border-radius: var(--rond-vlak); background: var(--papier); cursor: pointer; }
.jfp-option:has(input:checked) { border: 2px solid var(--hart); padding: 15px; box-shadow: 0 0 0 4px var(--magnolia-300); }
.jfp-option__top { display: flex; justify-content: space-between; align-items: flex-start; }
.jfp-option__top input { width: 22px; height: 22px; margin: 0; accent-color: var(--hart); }
.jfp-option__art { width: 56px; height: 64px; display: block; }
.jfp-option__art--foto { background: var(--magnolia-300); border: 6px solid var(--magnolia-100); transform: rotate(-4deg); }
.jfp-option__art--eigen { background: var(--hart); border-radius: 4px; position: relative; }
.jfp-option__art--eigen::after { content: ""; position: absolute; left: 16px; top: 20px; width: 24px; height: 24px; border-radius: var(--rond-pil); border: 3px solid var(--magnolia-300); }
.jfp-option__label { font-weight: 700; font-size: 16px; line-height: 22px; }
.jfp-hint-eigen { display: none; }
.jfp-fieldset:has(input[value=eigen]:checked) .jfp-hint-eigen { display: block; }

.jfp-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.jfp-photo { position: relative; display: block; aspect-ratio: 1; margin: 0; border-radius: var(--rond-veld); cursor: pointer; }
.jfp-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--rond-veld); display: block; }
.jfp-photo input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.jfp-photo:has(input:checked) { box-shadow: 0 0 0 4px var(--magnolia-50), 0 0 0 7px var(--hart); }
.jfp-photo:has(input:focus-visible) { outline: 3px solid var(--magnolia-300); outline-offset: 8px; }
.jfp-photo__check { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: var(--rond-pil); background: var(--hart); color: var(--papier); display: none; align-items: center; justify-content: center; }
.jfp-photo__check .jfp-icon { width: 16px; height: 16px; }
.jfp-photo:has(input:checked) .jfp-photo__check { display: flex; }
.jfp-photo--new, .jfp-photo--none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center; font-size: 15px; line-height: 20px; }
.jfp-photo--new { border: 2px dashed var(--tak-zacht); color: var(--hart); font-weight: 700; }
.jfp-photo--new.has-file { border-style: solid; border-color: var(--hart); background: var(--magnolia-100); }
.jfp-photo--none { background: var(--magnolia-100); color: var(--tak-zacht); }
.jfp-photos--manage .jfp-photo { aspect-ratio: auto; cursor: default; text-align: center; }
.jfp-photos--manage .jfp-photo img { aspect-ratio: 1; height: auto; }

.jfp-message { gap: 8px; }
.jfp-message__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jfp-dictate.is-listening { background: var(--hart); color: var(--papier) !important; }
.jfp-dictate.is-listening::before { content: ""; width: 8px; height: 8px; border-radius: var(--rond-pil); background: var(--magnolia-300); animation: jfp-luister 1.2s ease-in-out infinite; }
@keyframes jfp-luister { 50% { opacity: .2; } }

/* De postzegel */
.jfp-stamp { display: inline-block; flex: none; filter: drop-shadow(0 6px 10px rgba(94, 31, 58, .18)); }
.jfp-stamp__paper { display: block; width: 100%; height: 100%; padding: 10px; background: var(--papier); -webkit-mask: var(--perforatie), linear-gradient(#000 0 0) content-box; mask: var(--perforatie), linear-gradient(#000 0 0) content-box; }
.jfp-stamp__paper img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jfp-stamp__plain { display: block; width: 100%; height: 100%; background: var(--magnolia-300); position: relative; overflow: hidden; }
.jfp-stamp__plain::after { content: ""; position: absolute; left: 50%; bottom: -18%; width: 56%; aspect-ratio: 1; transform: translateX(-50%); border-radius: var(--rond-pil); background: var(--hart); }
.jfp-stamp--small { width: 96px; height: 116px; transform: rotate(-4deg); }
.jfp-stamp--hero { width: 176px; height: 208px; align-self: center; transform: rotate(-4deg); margin: 8px 0 4px; }
.jfp-stamp--hero .jfp-stamp__paper, .jfp-stamp--preview .jfp-stamp__paper { padding: 16px; }

/* Voorbeeld van de kaart */
.jfp-cardpreview { position: relative; margin: 0; padding-top: 196px; }
.jfp-cardpreview__inside { background: var(--papier); border-radius: 6px; box-shadow: var(--schaduw-kaart); padding: 64px 28px 28px; min-height: 260px; }
.jfp-cardpreview__text { font-size: 19px; line-height: 30px; white-space: pre-line; overflow-wrap: anywhere; }
.jfp-cardpreview__from { margin-top: 14px !important; font-family: var(--font-display); font-size: 20px; line-height: 28px; color: var(--hart); }
.jfp-stamp--preview { position: absolute; top: 0; left: 50%; width: 200px; height: 236px; transform: translateX(-50%) rotate(-4deg); filter: drop-shadow(0 10px 18px rgba(94, 31, 58, .22)); }
.jfp-cardpreview__own { position: absolute; top: 0; left: 50%; width: 212px; height: 212px; transform: translateX(-50%) rotate(-3deg); border-radius: 4px; overflow: hidden; box-shadow: var(--schaduw-kaart); }
.jfp-cardpreview__own img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Inloggen */
.jfp-login { align-items: stretch; text-align: center; }
.jfp-login .jfp-form { text-align: left; }

@media (prefers-reduced-motion: reduce) {
	.jfp-dictate.is-listening::before { animation: none; }
}
.jfp-field .jfp-muted, .jfp-field p { font-weight: 400; }

/* v0.4: inloggen, families beheren, account verwijderen */
.jfp-btn--danger { background: var(--fout); border-color: var(--fout); }
.jfp-btn--danger:hover { background: #7f2222; border-color: #7f2222; }
.jfp-link--quiet { color: var(--tak-zacht); font-size: 15px; }
.jfp-center { text-align: center; }
.jfp-list { margin: 0 0 16px; padding-left: 22px; }
.jfp-list li { margin-bottom: 8px; }
.jfp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.jfp-code { font-size: 26px; letter-spacing: 0.2em; text-align: center; font-variant-numeric: tabular-nums; }

/* Deellink */
.jfp-btn--whatsapp { background: var(--blad); border-color: var(--blad); }
.jfp-btn--whatsapp:hover { background: #3c5337; border-color: #3c5337; }
.jfp-btn[hidden] { display: none; }
.jfp-share-row { display: flex; gap: 12px; }
.jfp-share-row .jfp-btn { flex: 1; }
.jfp-link-row { display: flex; gap: 20px; flex-wrap: wrap; }

/* Adres opzoeken */
.jfp-address { display: grid; gap: 12px; }
.jfp-address__result { margin: -4px 0 0; min-height: 1.4em; font-size: 15px; color: var(--tak-zacht); }
.jfp-address__result:empty { display: none; }
.jfp-address__result.is-ok { color: var(--blad); font-weight: 700; }
.jfp-address__result.is-ok::before { content: "✓ "; }
.jfp-address__result.is-error { color: var(--fout); }
.jfp-address__result.is-warn { color: var(--honing); }
[data-jfp-address-manual][hidden] { display: none; }
