/*
 * 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.
 */

/* classic-portal — a bank that has had a web presence since about 2004 and has
 * tidied it up rather than replaced it.
 *
 * Character: a wide content column with facts down the side, dense type, serif
 * headings, rules instead of shadows, and no rounded corners unless the bank's
 * own tokens ask for them. It should not be mistakable for `modern-cards` when
 * the two are open side by side — that is the whole point of having skins at
 * all (ROADMAP.md §8.2).
 *
 * Every colour, face and measure comes from a --bank-* custom property. The
 * skin decides the STRUCTURE; the bank decides how it looks. Nothing here may
 * hard-code a colour that a bank might reasonably want to own. */

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bank-surface);
	color: var(--bank-on-surface);
	font-family: var(--bank-font);
	font-size: 16px;
	line-height: 1.55;
}

h1, h2, h3, .bank-name {
	font-family: var(--bank-font-heading);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

a { color: var(--bank-primary); }
a:hover { color: var(--bank-accent); }

/* -- masthead ----------------------------------------------------------- */

.bank-head {
	background: var(--bank-primary);
	color: var(--bank-on-primary);
	padding: calc(14px * var(--bank-density)) 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}
.bank-id {
	display: flex; align-items: center; gap: 12px;
	color: inherit; text-decoration: none;
}
.bank-mark { display: block; line-height: 0; }
.bank-mark svg { display: block; border-radius: var(--bank-radius); }
.bank-names { display: flex; flex-direction: column; }
.bank-name { font-size: 21px; }
.bank-tagline {
	font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
	opacity: .8; font-family: var(--bank-font);
}

/* A thin accent rule under the masthead: the one flourish this skin allows
   itself, and it is in the bank's own second colour. */
.bank-rule { height: 3px; background: var(--bank-accent); }

.langswitch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.langswitch .label { opacity: .6; }
.langswitch select {
	font: inherit; color: var(--bank-on-primary); background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.28); border-radius: var(--bank-radius);
	padding: 3px 7px;
}
/* The list itself is drawn by the operating system, which does not inherit the
   masthead's colours — so the options are given a ground of their own rather
   than being left as light-on-light. */
.langswitch select option { color: var(--bank-on-surface); background: var(--bank-surface); }
.langswitch button { font: inherit; margin-left: 6px; }

/* -- the two columns ---------------------------------------------------- */

.bank-main {
	max-width: 1060px;
	margin: 0 auto;
	padding: calc(28px * var(--bank-density)) 20px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: calc(28px * var(--bank-density));
	align-items: start;
}
@media (max-width: 820px) {
	.bank-main { grid-template-columns: minmax(0, 1fr); }
	.page-side { order: -1; }   /* on a phone, signing in comes first */
}

h1 { font-size: 27px; margin: 0 0 10px 0; }
h2 { font-size: 18px; margin: 0 0 12px 0; }
.lede { font-size: 17px; color: var(--bank-muted); margin: 0 0 26px 0; }

/* -- products ----------------------------------------------------------- */


.product {
	border-bottom: 1px solid var(--bank-line);
	padding: calc(16px * var(--bank-density)) 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px;
	align-items: start;
}
.product-name { font-family: var(--bank-font-heading); font-size: 17px; font-weight: 600; }
.product-type {
	display: inline-block; margin-left: 8px; font-size: 11px;
	text-transform: uppercase; letter-spacing: .07em;
	color: var(--bank-primary); border: 1px solid var(--bank-line);
	border-radius: var(--bank-radius); padding: 1px 6px; vertical-align: 2px;
	font-family: var(--bank-font);
}
.product-desc { color: var(--bank-muted); margin: 4px 0 0 0; }
.product-terms { margin: 8px 0 0 0; padding: 0; list-style: none; font-size: 14px; }
.product-terms li { color: var(--bank-muted); }
.product-terms li::before { content: "— "; }
.product-cta { text-align: right; }
.product-note { font-size: 12px; color: var(--bank-muted); margin: 6px 0 0 0; }
.products-none { color: var(--bank-muted); }

/* -- side panels -------------------------------------------------------- */

.panel {
	border: 1px solid var(--bank-line);
	border-radius: var(--bank-radius);
	padding: calc(18px * var(--bank-density));
	margin-bottom: 18px;
	background: #fff;
}
.panel-login { border-top: 3px solid var(--bank-primary); }

label {
	display: block; font-size: 13px; color: var(--bank-muted);
	margin: 0 0 5px 0;
}
input[type="text"], input[type="password"] {
	width: 100%; padding: 9px 11px; font: inherit; font-size: 15px;
	border: 1px solid var(--bank-line); border-radius: var(--bank-radius);
	margin-bottom: 14px; background: var(--bank-surface); color: inherit;
}
input:focus { outline: 2px solid var(--bank-accent); outline-offset: 1px; border-color: transparent; }

button, .button {
	display: inline-block; padding: 10px 18px; font: inherit; font-size: 15px;
	font-weight: 600; cursor: pointer; text-decoration: none;
	background: var(--bank-primary); color: var(--bank-on-primary);
	border: 1px solid var(--bank-primary); border-radius: var(--bank-radius);
}
button:hover, .button:hover { background: var(--bank-accent); border-color: var(--bank-accent); color: #fff; }
.button-quiet {
	background: transparent; color: var(--bank-primary);
	border: 1px solid var(--bank-line);
}
.button-quiet:hover { background: var(--bank-primary); color: var(--bank-on-primary); }

.panel-facts dl { margin: 0; font-size: 14px; }
.panel-facts dt {
	color: var(--bank-muted); font-size: 12px; text-transform: uppercase;
	letter-spacing: .06em; margin-top: 10px;
}
.panel-facts dt:first-child { margin-top: 0; }
.panel-facts dd { margin: 2px 0 0 0; }

.form-error { color: var(--bank-danger); font-size: 13px; margin: -6px 0 12px 0; }
.register-note { font-size: 13px; color: var(--bank-muted); margin: 14px 0 0 0; }

/* -- footer ------------------------------------------------------------- */

.bank-foot {
	border-top: 1px solid var(--bank-line);
	margin-top: 40px;
	padding: 22px 20px 40px 20px;
	color: var(--bank-muted);
	font-size: 13px;
	text-align: center;
}
.bank-foot p { margin: 0 0 5px 0; }
.bank-foot-meta { opacity: .8; }

/* The dark-mode question is the bank's, not the skin's: a bank whose tokens are
   dark reads as dark here, and one whose tokens are light stays light whatever
   the viewer's system says. A simulated bank should look the same to everyone
   testing against it. */

/* An uploaded logo stands in for the generated mark. Height is fixed so that
   whatever an administrator uploads sits on the same baseline as the text
   beside it; width follows, because a logo is not necessarily square. */
.bank-logo { display: block; height: 40px; width: auto; max-width: 260px; }

/* A hero image, when the bank has one. It is the bank's own picture, so the
   skin only decides where it goes and how much room it may take. */
.bank-hero {
	display: block; width: 100%; height: auto; max-height: 260px;
	object-fit: cover; border-radius: var(--bank-radius);
	margin: 0 0 24px 0;
}


/* The registration form is the one place a bank asks for more than two fields,
   so it gets a grid of its own rather than the single column the login panel
   uses. */
.reggrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
select {
	width: 100%; padding: 9px 11px; font: inherit; font-size: 15px;
	border: 1px solid var(--bank-line); border-radius: var(--bank-radius);
	margin-bottom: 14px; background: var(--bank-surface); color: inherit;
}
.fieldhint { font-size: 13px; color: var(--bank-muted); margin: -10px 0 14px 0; }

/* -- accounts ------------------------------------------------------------ */

.notice-line {
	background: color-mix(in srgb, var(--bank-accent) 12%, #fff);
	border-left: 3px solid var(--bank-accent);
	padding: 8px 12px; margin: 0 0 14px 0; font-size: 14px;
}
.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-card {
	display: block; text-decoration: none; color: inherit;
	border-bottom: 1px solid var(--bank-line); padding: 14px 0;
}
.acct-card:hover { background: color-mix(in srgb, var(--bank-primary) 4%, transparent); }
.acct-card-name { font-family: var(--bank-font-heading); font-weight: 600; }
.acct-card-num { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--bank-muted); }
.acct-card-bal { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-card-extra { font-size: 13px; color: var(--bank-muted); }
.acct-card-late { font-size: 12px; color: var(--bank-danger); margin-top: 2px; }

.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.acct-actions { flex: 0 0 auto; }

.bal-row {
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
	padding: 12px 0; border-bottom: 1px solid var(--bank-line);
}
.bal-amount { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.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: 600;
}
.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; font-size: 14px; }
.inline-fields input { width: 6em; margin: 0; }
.inline-fields select { width: auto; margin: 0; }

.tablewrap { overflow-x: auto; }
.tablewrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tablewrap th { text-align: left; font-weight: 500; color: var(--bank-muted);
				border-bottom: 1px solid var(--bank-line); padding: 6px 8px; font-size: 12px;
				text-transform: uppercase; letter-spacing: .05em; }
.tablewrap td { padding: 8px; border-bottom: 1px solid var(--bank-line); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.actions { margin: 20px 0 0 0; }
.cardbox, .loanbox { margin-top: 18px; }
.cardbox h3, .loanbox h3 { margin-bottom: 6px; }
.waiting { margin-top: 20px; }
.waiting table td { border-bottom: 1px dashed var(--bank-line); }

/* -- 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; }

/* Choosing whose money you are about to move (§29.5). */
.role-list { list-style: none; margin: 0 0 14px 0; padding: 0; }
.role-item { border: 1px solid var(--bank-line); margin-bottom: 8px; background: var(--bank-surface); }
.role-item-current { border-left: 4px solid var(--bank-primary); }
.role-item label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.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: bold; 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); background: var(--bank-surface); padding: 14px 16px; margin: 0 0 14px 0; }
.cop-close-match { border-left: 4px solid var(--bank-accent); }
.cop-no-match { border-left: 4px solid var(--bank-danger); }
.cop-headline { font-weight: bold; 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; }
