/*
 * Watcher Customer Portal, styled after the operators' websites: their header, square buttons and
 * the Jost font. The colours are the profile's (colors.css), these are the defaults.
 */
@font-face {
    font-family: Jost;
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../vendor/jost/jost-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: Jost;
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../vendor/jost/jost-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* what a profile's colors.css sets */
:root {
    --brand-dark: #000b23;
    --brand-accent: #46b130;
    --brand-topbar: var(--brand-dark);
    --brand-hover: var(--brand-dark);
}
/* the portal's own */
:root {
    --bg: #f2f6fb;
    --card: #fff;
    --text: #101010;
    --muted: #6d7a8c;
    --line: #e4e9f0;
    --danger: #c62828;
    --danger-bg: #fdecea;
    --warn: #9a5b00;
    --warn-bg: #fff4e0;
    --ok: #2e7d32;
    --ok-bg: #e8f5e9;
    --info: #1d4f91;
    --info-bg: #e8f0fb;
    --shadow: 0 10px 30px rgba(0, 11, 35, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* the content takes what the window has left, so the footer of a short page is at its bottom
   (dvh where the browser knows it, without the bars a phone shows and hides) */
body { margin: 0; font: 17px/1.6 Jost, system-ui, sans-serif; color: var(--text); background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
a { color: var(--brand-accent); text-decoration: none; font-weight: 500; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.4rem; margin: 0; }
h2 { font-size: 1.3rem; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }

/* the header of the operator's website, of its sizes: a bar with the contacts, the logo in a block,
   the menu, and a block in the accent */
header.top { background: var(--brand-dark); color: #fff; display: grid; grid-template-columns: auto 1fr auto auto; }
header.top .logo { grid-row: 1 / 3; display: flex; align-items: center; padding: 0 50px; border-right: 1px solid rgba(255, 255, 255, .12); }
/* as tall as the logo on the operator's website, which the profile's colors.css says */
header.top .logo img { height: var(--logo-height, 94px); object-fit: contain; display: block; }
header.top .logo span { font-weight: 700; font-size: 1.3rem; color: #fff; }
header.top .bar { grid-column: 2 / 5; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 0 24px; min-height: 47px; font-size: .95rem; background: var(--brand-topbar); border-bottom: 1px solid rgba(255, 255, 255, .12); }
header.top .bar .contacts { display: flex; gap: 1.2rem; flex-wrap: wrap; }
header.top .bar a, header.top .bar span { color: #fff; font-weight: 400; }
header.top nav { display: flex; align-items: center; gap: 2rem; padding: 0 28px; min-height: 101px; overflow-x: auto; }
header.top nav a, header.top nav span { color: #fff; font-weight: 600; font-size: 1.05rem; white-space: nowrap; padding: 1.6rem 0; }
header.top nav a:hover, header.top nav [aria-current] { color: var(--brand-accent); }
/* who is signed in, beside signing out */
header.top .who { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: 0 22px; line-height: 1.35; border-left: 1px solid rgba(255, 255, 255, .12); }
header.top .who strong { font-weight: 600; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top .who span { font-size: .85rem; color: rgba(255, 255, 255, .7); white-space: nowrap; }
header.top form.sign-out { display: flex; margin: 0; }
header.top .cta { font: inherit; font-weight: 700; color: #fff; background: var(--brand-accent); border: 0; padding: 0 26px; cursor: pointer; white-space: nowrap; }
header.top .cta::after { content: " →"; }
header.top .cta:hover { background: var(--brand-hover); }

/* the title of a page, as the sections of the website start */
.title { padding: 48px 0 28px; }
.title .muted { margin-top: .3rem; }
/* a title with what the page offers beside it, at the right */
.title.with-action { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; }
.kicker { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .4rem; color: var(--brand-accent); font-weight: 700; }
.kicker::after { content: "✓"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-accent); color: #fff; font-size: .7rem; }
/* as an item of the body's column, auto margins would shrink it to its content, hence the width */
main.wrap { padding-bottom: 64px; flex: 1 0 auto; width: 100%; }

.grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
.card { background: var(--card); box-shadow: var(--shadow); padding: 30px; }
.card.wide { grid-column: 1 / -1; }
.card.narrow { max-width: 540px; }
.card.due { border-top: 4px solid var(--danger); }
.card.settled { border-top: 4px solid var(--ok); }
.card .head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .6rem 1rem; margin-bottom: 1rem; }
.card .head h2 { margin: 0; }
/* under the head of a card, as the operator's website has it: a thin line across, and on it
   a short thick one in the operator's colour; drawn as backgrounds, since a head with a
   button is a flex box, where a pseudo-element would be one more item */
.card > h2, .card > .head { padding-bottom: .85rem; margin-bottom: 1.2rem;
    background: linear-gradient(var(--brand-accent), var(--brand-accent)) left bottom / 40px 3px no-repeat,
        linear-gradient(var(--line), var(--line)) left bottom 1px / 100% 1px no-repeat; }
/* the line under the heading of a form takes the place of its first section's */
.card > form > fieldset:first-of-type { border-top: 0; margin-top: 1rem; padding-top: 0; }
.card .head:has(.button) { align-items: center; }
.card .head .button { flex: none; }
.stack > * + * { margin-top: 30px; }

.amount { font-size: 2.6rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.amount.due { color: var(--danger); }
.amount.settled { color: var(--ok); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 700; font-size: .95rem; padding: .6rem .75rem; border-bottom: 2px solid var(--brand-dark); }
td { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.nowrap td { white-space: nowrap; }
tbody tr:hover { background: #f7f9fc; }
tfoot td { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
tfoot .due { color: var(--danger); }
.badge { display: inline-block; padding: .1rem .55rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; color: var(--muted); background: var(--bg); }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.due { color: var(--warn); background: var(--warn-bg); }
.badge.late { color: var(--danger); background: var(--danger-bg); }

/* a contract, and under it in smaller print where it is installed, its services and addresses */
table.contracts td { vertical-align: top; }
table.contracts td > div { margin-top: .2rem; }
table.contracts .small { font-size: .9rem; overflow-wrap: anywhere; }

dl.facts { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: .45rem 0; margin: 0; }
dl.facts.pay-to { margin: .6rem 0 1.25rem; }
/* a row set apart from those above by a line across both columns */
dl.facts > .apart { margin-top: .4rem; padding-top: .85rem; border-top: 1px solid var(--line); }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; padding-left: 1.25rem; font-weight: 500; overflow-wrap: anywhere; }
/* several things under one heading, such as the e-mails, each with its note under it */
dl.facts dd > div + div { margin-top: .4rem; }

/* the codes are drawn at twice their size, and their modules have to stay sharp */
.pay-codes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.5rem 2rem; margin-top: 1.5rem; }
.pay-codes p { flex-basis: 100%; margin: 0; }
.pay-codes figure { margin: 0; max-width: 100%; }
.pay-codes img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.pay-codes figcaption { margin-top: .4rem; font-size: .9rem; color: var(--muted); }

/* buttons as the website has them: square, capitals, an arrow */
.button, button.button, input.button { display: inline-flex; align-items: center; gap: .6rem; font: inherit; font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--brand-accent); border: 0; padding: .95rem 1.8rem; cursor: pointer; }
.button::after { content: "→"; font-size: 1.1rem; }
.button:hover { color: #fff; background: var(--brand-dark); }
.button.small { padding: .45rem .9rem; font-size: .78rem; }
.button.small::after { content: "↓"; }
.button.small.next::after { content: "→"; }
.button.wide { width: 100%; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 1.5rem; }

form .field { margin: .9rem 0 0; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], select, textarea { width: 100%; font: inherit; padding: .45rem .7rem; border: 1px solid #d3dbe6; background: #fff; color: var(--text); }
textarea { min-height: 7rem; }
input:focus, select:focus, textarea:focus, .button:focus-visible, .cta:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.field.checkbox label, label.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; margin: .2rem 0 0; flex: none; accent-color: var(--brand-accent); }
.hint { color: var(--muted); font-size: .9rem; margin-top: .35rem; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0 0; padding: .5rem 0 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0 .5rem 0 0; }
.columns { display: grid; gap: 0 1.5rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.columns .wide { grid-column: span 2; }
.columns .wider { grid-column: span 3; }
.uses { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .5rem; }
.uses label { font-weight: 400; margin: 0; }

/* parts of a form shown only when asked for, without a script */
details.more { margin-top: 1rem; }
details.more > summary { cursor: pointer; color: var(--brand-accent); font-weight: 600; }
details.more[open] > summary { margin-bottom: .4rem; }
details.add { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
details.add fieldset { border: 0; margin: 0; padding: 0; }
.small { font-size: .9rem; }
ul.changes { margin: 0 0 1.5rem; padding-left: 1.2rem; }
ul.changes li { margin: .35rem 0; }

/* the consents: the operator's text, then a choice in each row */
.consent-text { color: var(--muted); }
.consent-text h4 { color: var(--text); margin: 0 0 .5rem; }
.consent-text li { margin-bottom: .4rem; }
.choice { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.choice label { font-weight: 600; margin: 0; }

.alert { margin: 1.5rem 0 0; padding: .8rem 1rem; border-left: 4px solid; }
.alert.error { color: var(--danger); background: var(--danger-bg); }
.alert.success { color: var(--ok); background: var(--ok-bg); }
.alert.info, .alert.default { color: var(--info); background: var(--info-bg); }
.error-message { color: var(--danger); font-size: .9rem; margin-top: .3rem; }

/* signing in: a light page with one card */
.signin { display: grid; place-items: center; padding: 64px 0; }
.signin .card { width: 100%; max-width: 460px; }
.signin h1 { font-size: 2rem; }

footer.site { background: var(--brand-dark); color: rgba(255, 255, 255, .7); padding: 28px 0; font-size: .95rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
footer.site a { color: #fff; }

/* a phone: the logo above the menu, which scrolls, and tables that become cards */
@media (max-width: 900px) {
    header.top { grid-template-columns: 1fr auto; }
    header.top .bar { display: none; }
    header.top .logo { grid-row: auto; padding: 12px 16px; border: 0; }
    header.top .logo img { height: 44px; }
    header.top nav { grid-column: 1 / -1; order: 3; gap: 1.4rem; padding: 0 16px; min-height: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
    header.top nav a, header.top nav span { padding: .8rem 0; }
    header.top .cta { padding: 0 18px; }
    header.top .who { grid-column: 1 / -1; order: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: .6rem; padding: .45rem 16px; border: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
    header.top .who strong { max-width: none; min-width: 0; flex: 0 1 auto; }
    h1 { font-size: 1.8rem; }
    .title { padding: 28px 0 18px; }
    .grid { grid-template-columns: 1fr; gap: 16px; }
    .stack > * + * { margin-top: 16px; }
    .card { padding: 20px; overflow-x: auto; }
    th, td { padding: .6rem .4rem; }
    .button.small { padding: .4rem .6rem; }
    .amount { font-size: 2.1rem; }
    table.cards thead { display: none; }
    table.cards tr { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
    table.cards td { border: 0; padding: 0; }
    table.cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
    table.cards tfoot tr { border: 0; }
    table.contracts thead { display: none; }
    table.contracts tr { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); }
    table.contracts td { display: block; border: 0; padding: .1rem 0; }
    table.contracts td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
    .signin { padding: 24px 0; }
    .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .columns .wider { grid-column: 1 / -1; }
}

/* a narrow phone: a field a row */
@media (max-width: 560px) {
    .columns { grid-template-columns: minmax(0, 1fr); }
    .columns .wide, .columns .wider { grid-column: auto; }
}
