/*
 * Copyright © 2026 Spinium Property Management OÜ - All rights reserved.
 * Author: Timo J. Rinne <tri@iki.fi>
 *
 * Unreleased and unlicensed. Any use is explicitly prohibited without a prior
 * written license from Spinium Property Management OÜ (https://spinium.com).
 * See COPYING.
 */

/* mobile-first — a bank whose web presence is its app, shown in a browser.
 *
 * Character: one column pinned to the viewport, an app bar at the top and a
 * fixed tab bar at the bottom, large touch targets, generous type, and content
 * that scrolls between them. It is also the skin an open-banking redirect on a
 * phone lands in, which is why the tap targets and the safe-area insets are
 * taken seriously rather than approximated.
 *
 * Unlike the other three it is not a document with navigation; it is a frame
 * with a scrolling middle. */

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

html, body { height: 100%; }
body {
	margin: 0;
	background: var(--bank-surface);
	color: var(--bank-on-surface);
	font-family: var(--bank-font);
	font-size: 17px;
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
}

.app {
	display: flex; flex-direction: column;
	min-height: 100%;
	max-width: 560px; margin: 0 auto;
	background: var(--bank-surface);
}

/* -- app bar ------------------------------------------------------------- */

.appbar {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; gap: 12px;
	padding: calc(12px * var(--bank-density)) 16px;
	padding-top: max(calc(12px * var(--bank-density)), env(safe-area-inset-top));
	background: var(--bank-primary); color: var(--bank-on-primary);
}
.appbar-mark { line-height: 0; }
.appbar-mark svg, .appbar-mark .bank-logo { display: block; border-radius: 10px; }
.bank-logo { height: 32px; width: auto; max-width: 160px; }
.appbar-name { font-family: var(--bank-font-heading); font-weight: 700; font-size: 18px; }

.langswitch { margin-left: auto; display: flex; gap: 4px; font-size: 13px; }
.langswitch .label { display: none; }
/* 44px is the smallest thing a thumb hits reliably, which is the whole premise
   of this skin. */
.langswitch select {
	font: inherit; color: var(--bank-on-primary); background: rgba(255,255,255,.2);
	border: 0; border-radius: 8px; padding: 6px 8px; min-height: 44px;
}
.langswitch select option { color: var(--bank-on-surface); background: var(--bank-surface); }
.langswitch button { font: inherit; min-height: 44px; margin-left: 4px; }

/* -- the scrolling middle ------------------------------------------------ */

.scroll { flex: 1; padding: 18px 16px 24px 16px; }
.page-main, .page-side { display: block; }
.page-side { margin-top: 20px; }

h1 { font-family: var(--bank-font-heading); font-size: 25px; margin: 0 0 8px 0;
	 letter-spacing: -0.02em; }
h2 { font-family: var(--bank-font-heading); font-size: 17px; margin: 22px 0 10px 0; }
.lede { color: var(--bank-muted); margin: 0 0 18px 0; }
a { color: var(--bank-primary); }
.tiny { font-size: 12px; color: var(--bank-muted); text-align: center; margin: 28px 0 0 0; }

/* Everything tappable is at least 48px tall. This is the skin an
   open-banking redirect lands in on a phone, so that is a requirement and not
   a preference. */
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px 0; }
input[type="text"], input[type="password"], input[type="date"], select {
	width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; font-size: 17px;
	border: 1px solid var(--bank-line); border-radius: var(--bank-radius);
	margin-bottom: 16px; background: #fff; color: inherit;
}
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--bank-accent) 45%, transparent); outline-offset: 1px; }
button, .button {
	display: block; width: 100%; min-height: 52px; padding: 14px 20px;
	font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
	text-align: center; text-decoration: none;
	background: var(--bank-primary); color: var(--bank-on-primary);
	border: 0; border-radius: var(--bank-radius);
	margin-bottom: 10px;
}
.button-quiet { background: #fff; color: var(--bank-primary);
				border: 2px solid var(--bank-primary); }
.buttonrow { display: flex; flex-direction: column; }

.form-error { color: var(--bank-danger); font-weight: 600; margin: -8px 0 14px 0; }
.fieldhint { font-size: 14px; color: var(--bank-muted); margin: -10px 0 16px 0; }
.reggrid { display: block; }

.panel { background: #fff; border-radius: var(--bank-radius);
		 padding: calc(18px * var(--bank-density)); margin-bottom: 14px; }

/* -- lists rather than tables -------------------------------------------- */

.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-card {
	display: block; text-decoration: none; color: inherit; background: #fff;
	border-radius: var(--bank-radius); padding: 16px; margin-bottom: 12px;
	min-height: 76px;
}
.acct-card:active { background: color-mix(in srgb, var(--bank-primary) 8%, #fff); }
.acct-card-name { font-family: var(--bank-font-heading); font-weight: 700; }
.acct-card-num { font-family: ui-monospace, Menlo, monospace; font-size: 12px;
				 color: var(--bank-muted); }
.acct-card-bal { font-size: 27px; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; }
.acct-card-extra { font-size: 13px; color: var(--bank-muted); }
.acct-card-late { font-size: 12px; color: var(--bank-danger); margin-top: 2px; }

.bal-row { background: #fff; border-radius: var(--bank-radius); padding: 14px 16px;
		   margin-bottom: 10px; }
.bal-amount { font-size: 24px; font-weight: 700; }
.bal-meta { font-size: 13px; color: var(--bank-muted); }
.bal-primary { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
			   color: var(--bank-accent); font-weight: 700; }

/* A movement list is a list, not a grid: a table does not fit a phone. */
.tablewrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tablewrap thead { display: none; }
.tablewrap tr { display: block; background: #fff; border-radius: var(--bank-radius);
				padding: 12px 14px; margin-bottom: 8px; }
.tablewrap td { display: block; border: 0; padding: 1px 0; }
.tablewrap td.num { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

.product { background: #fff; border-radius: var(--bank-radius); padding: 16px; margin-bottom: 12px; }
.product-name { font-family: var(--bank-font-heading); font-weight: 700; font-size: 17px; }
.product-type { display: block; font-size: 12px; color: var(--bank-accent);
				text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.product-desc { color: var(--bank-muted); margin: 6px 0; }
.product-terms { margin: 8px 0 0 0; padding: 0; list-style: none; font-size: 14px;
				 color: var(--bank-muted); }
.product-terms li::before { content: "• "; }
.product-cta { margin-top: 12px; }
.product-note { font-size: 12px; color: var(--bank-muted); }
.products-none, .muted { color: var(--bank-muted); }

dl { margin: 0; }
dt { font-size: 13px; color: var(--bank-muted); margin-top: 10px; }
dt:first-child { margin-top: 0; }
dd { margin: 2px 0 0 0; font-size: 17px; }

.acct-head { display: block; }
.acct-actions { margin-top: 12px; }

/* -- tab bar ------------------------------------------------------------- */

.tabbar {
	position: sticky; bottom: 0; z-index: 5;
	display: flex; background: #fff;
	border-top: 1px solid var(--bank-line);
	padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
	padding: 10px 4px; min-height: 56px;
	color: var(--bank-muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tabbar a:active { color: var(--bank-primary); }
.tab-ico { font-size: 19px; line-height: 1; }
.tab-out { color: var(--bank-danger); }

.bank-hero { display: block; width: 100%; height: auto; max-height: 180px;
			 object-fit: cover; border-radius: var(--bank-radius); margin-bottom: 16px; }

.notice-line {
	background: color-mix(in srgb, var(--bank-accent) 12%, #fff);
	border-left: 3px solid var(--bank-accent);
	padding: 10px 14px; margin: 0 0 14px 0; font-size: 14px;
}
.bal-form { border-bottom: 1px solid var(--bank-line); padding-bottom: 14px; margin-bottom: 14px; }
.bal-form h3 { font-size: 15px; margin: 0 0 10px 0; font-family: var(--bank-font-heading); }
.inline-fields { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-fields input { width: 6em; margin: 0; }
.inline-fields select { width: auto; margin: 0; }
.nowrap { white-space: nowrap; }

.actions { margin-top: 18px; }
.cardbox, .loanbox { margin-top: 18px; }
.cardbox h3, .loanbox h3 { margin-bottom: 6px; }
.waiting { margin-top: 18px; }

/* -- scheduled instruments, beneficiaries and statements (§14) ----------- */

.instr-list { list-style: none; margin: 0 0 18px 0; padding: 0; }
.instr {
	border: 1px solid var(--bank-line); border-radius: var(--bank-radius);
	padding: 12px 14px; margin-bottom: 10px;
}
.instr-head { font-size: 15px; }
.instr-what { margin-top: 2px; }
.instr-meta { font-size: 13px; color: var(--bank-muted); margin-top: 2px; }
.instr-status {
	display: inline-block; font-size: 12px; padding: 1px 7px;
	border-radius: 999px; border: 1px solid var(--bank-line);
	vertical-align: 2px;
}
.instr-active { border-color: var(--bank-primary); color: var(--bank-primary); }
.instr-failed { border-color: var(--bank-danger); color: var(--bank-danger); }
.instr-cancelled, .instr-completed { opacity: .65; }
.instr .buttonrow { margin-top: 8px; }
.instr form { display: inline; margin: 0; }

/* A form nobody has asked for yet stays folded away, so the page opens as a
   list of what exists rather than as a wall of empty fields. */
.newform { margin-bottom: 18px; }
.newform > summary {
	cursor: pointer; font-weight: 600; padding: 8px 0;
	color: var(--bank-primary);
}
.newform[open] > summary { margin-bottom: 8px; }

.inlineform {
	display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
	margin-bottom: 18px;
}
.inlineform label { margin: 0; align-self: center; }
.inlineform input, .inlineform select, .inlineform button { margin: 0; width: auto; }

.instr { padding: 14px; }
.instr-head { font-size: 16px; }
.inlineform input, .inlineform select, .inlineform button { min-height: 44px; }
.newform > summary { min-height: 44px; display: flex; align-items: center; }

/* Choosing whose money you are about to move (§29.5). Full-width rows: this is
   a thumb reaching for one of two answers. */
.role-list { list-style: none; margin: 0 0 16px 0; padding: 0; display: grid; gap: 10px; }
.role-item { border: 1px solid var(--bank-line); border-radius: 12px; }
.role-item-current { border-color: var(--bank-primary); }
.role-item label { display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer; min-height: 44px; }
.role-body { display: flex; flex-direction: column; gap: 2px; }
.role-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--bank-muted); }
.role-name { font-weight: 600; font-size: 16px; }
.role-meta { font-size: 12px; color: var(--bank-muted); }

/* Confirmation of Payee (§30.2). Bank tokens only, and the verdict is in the
   words: colour alone is not a message every payer receives. */
.cop { border: 1px solid var(--bank-line); border-radius: 12px; padding: 14px; margin: 0 0 14px 0; }
.cop-close-match { border-color: var(--bank-accent); }
.cop-no-match { border-color: var(--bank-danger); }
.cop-headline { font-weight: 600; font-size: 16px; margin: 0 0 6px 0; }
.cop-line { margin: 2px 0; color: var(--bank-muted); }
.cop-warn { font-size: 13px; margin: 0 0 14px 0; }
