/*
 * The portal's own styles. The look comes from the Zavanto design system: tokens in zavanto/css/tokens.css and the
 * zv- components in zavanto/css/components.css (both copied from Zavanto/Design, see design/zavanto/README.md).
 * This file only adds page layout, icons and what the portal mockup has that the components lack. Token names
 * only, never colour values. No external fonts or CDNs: the CSP only allows files from this site.
 */

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

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 22px;
}

/* The search and the menu hide elements with the hidden attribute; components that set display must not win. */
[hidden] {
    display: none !important;
}

h1, h2, h3, p {
    margin: 0;
}

a {
    color: var(--accent-ink);
}

    a:hover {
        text-decoration-thickness: 2px;
    }

a.zv-btn {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

code {
    font-family: var(--font-mono);
}

.muted {
    color: var(--ink-muted);
}

/* Anchored sections stop below the top edge, not under it. */
[id] {
    scroll-margin-top: var(--space-5);
}

/* Icons (Shared/Icon.razor): 2px line, round ends, currentColor. */

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-bold {
    stroke-width: 2.4;
}

/* Page frame (Shared/MainLayout.razor) */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1 1 auto;
    width: 100%;
    padding: 48px 0 72px;
}

.site-main-home {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    padding: 0 0 var(--space-9);
}

    /* Flex items shrink to their content; the sections keep their full page-max width. */
    .site-main-home > .zv-section,
    .zv-band > .zv-section {
        width: 100%;
    }

.zv-brand .zv-logo {
    width: 110px;
    height: 22px;
}

.zv-nav a.zv-lang .icon {
    width: 18px;
    height: 18px;
}

/* The theme button shows where it switches to: a moon in light theme, a sun in dark theme. */
.theme-toggle span,
.menu-toggle span {
    display: flex;
}

.theme-toggle .theme-icon-sun,
.theme-toggle[data-current="dark"] .theme-icon-moon {
    display: none;
}

.theme-toggle[data-current="dark"] .theme-icon-sun {
    display: flex;
}

.menu-toggle .menu-icon-close,
.menu-toggle[aria-expanded="true"] .menu-icon-open {
    display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon-close {
    display: flex;
}

.zv-nav .zv-icon-btn:hover {
    color: var(--on-chrome);
    background: var(--chrome-active);
}

.menu-toggle,
.mobile-menu {
    display: none;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--on-chrome);
    font-weight: 600;
    font-size: 17px;
    text-decoration: none;
    border-bottom: 1px solid var(--chrome-line);
}

    .mobile-menu a:last-child {
        border-bottom: none;
        color: var(--on-chrome-muted);
    }

    .mobile-menu a:hover {
        color: var(--on-chrome);
    }

/* Phones: with scripts the section links move into a menu behind a button; without, they wrap below the logo. */
@media (max-width: 760px) {
    .js .portal-navlink {
        display: none !important;
    }

    /* Only the home header has the menu button, so only it is sure to fit on one row. The other pages' header
       (logo, Apps, language, theme) is about 354px wide and must be free to wrap, or the page scrolls sideways on
       narrow phones and with larger system fonts. MobileLayoutTests checks it. */
    .js .zv-header-merged .zv-header-inner {
        flex-wrap: nowrap;
    }

    /* Tighter on the other pages, so the header stays on one row down to about 370px; below that the menu wraps to
       a row of its own, at the right edge. */
    .zv-header:not(.zv-header-merged) .zv-header-inner {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .zv-header:not(.zv-header-merged) .zv-nav {
        margin-left: auto;
        gap: 0;
    }

        .zv-header:not(.zv-header-merged) .zv-nav a {
            padding: 0 var(--space-3);
        }

            .zv-header:not(.zv-header-merged) .zv-nav a.zv-lang {
                padding: 0 var(--space-2);
            }

    .js .menu-toggle {
        display: inline-flex;
    }

    .js .mobile-menu {
        display: flex;
        flex-direction: column;
        padding: 0 var(--space-5) var(--space-4);
        border-top: 1px solid var(--chrome-line);
    }

    /* Not on the home page, where the ChromeHero continues straight from the header. */
    .site-main:not(.site-main-home) {
        padding-top: var(--space-6);
    }
}

/* ---------- Home: ChromeHero ---------- */

.hero-search-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 540px;
}

.zv-hero-search-icon .icon {
    width: 20px;
    height: 20px;
}

.zv-hero-search-clear .icon {
    width: 18px;
    height: 18px;
}

.zv-hero-search .zv-input::placeholder {
    color: var(--ink-muted);
}

/* IconCluster: every icon links to its app and names it in a tooltip. */
.cluster-link {
    position: relative;
    display: inline-flex;
    border-radius: 15px;
    text-decoration: none;
    transition: transform .15s, opacity .15s;
}

.zv-icon-cluster .cluster-link:nth-child(5n+2),
.zv-icon-cluster .cluster-link:nth-child(5n+4) {
    transform: translateY(16px);
}

.cluster-link:hover,
.cluster-link:focus-visible {
    transform: translateY(-5px);
    z-index: 3;
}

.zv-icon-cluster .cluster-link:nth-child(5n+2):hover,
.zv-icon-cluster .cluster-link:nth-child(5n+4):hover,
.zv-icon-cluster .cluster-link:nth-child(5n+2):focus-visible,
.zv-icon-cluster .cluster-link:nth-child(5n+4):focus-visible {
    transform: translateY(11px);
}

.cluster-link:focus-visible {
    outline: 2px solid var(--on-chrome);
    outline-offset: 3px;
}

.zv-icon-cluster:hover .cluster-link:not(:hover) {
    opacity: .5;
}

.cluster-tip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 4px);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    background: var(--surface-raised);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    font-size: 13px;
    line-height: 18px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
    transition: opacity .15s, transform .15s;
}

    .cluster-tip strong {
        font-size: 14px;
        font-weight: 700;
    }

    .cluster-tip span {
        color: var(--ink-muted);
    }

.cluster-link:hover .cluster-tip,
.cluster-link:focus-visible .cluster-tip {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Tooltips at the edges open inwards. */
.zv-icon-cluster .cluster-link:nth-child(5n+1) .cluster-tip {
    left: 0;
    transform: translate(0, 4px);
}

.zv-icon-cluster .cluster-link:nth-child(5n) .cluster-tip,
.zv-icon-cluster .cluster-link:nth-child(5n+4) .cluster-tip {
    left: auto;
    right: 0;
    transform: translate(0, 4px);
}

.zv-icon-cluster .cluster-link:nth-child(5n+1):hover .cluster-tip,
.zv-icon-cluster .cluster-link:nth-child(5n+1):focus-visible .cluster-tip,
.zv-icon-cluster .cluster-link:nth-child(5n):hover .cluster-tip,
.zv-icon-cluster .cluster-link:nth-child(5n):focus-visible .cluster-tip,
.zv-icon-cluster .cluster-link:nth-child(5n+4):hover .cluster-tip,
.zv-icon-cluster .cluster-link:nth-child(5n+4):focus-visible .cluster-tip {
    transform: translate(0, 0);
}

/* A smaller suite gets fewer columns (3 for up to six apps, 2 for up to four). */
.zv-icon-cluster.cluster-3 {
    grid-template-columns: repeat(3, 56px);
}

.zv-icon-cluster.cluster-2 {
    grid-template-columns: repeat(2, 56px);
}

.zv-icon-cluster.cluster-3 .cluster-link,
.zv-icon-cluster.cluster-2 .cluster-link {
    transform: none;
}

.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n+2),
.zv-icon-cluster.cluster-2 .cluster-link:nth-child(2n) {
    transform: translateY(16px);
}

.zv-icon-cluster.cluster-3 .cluster-link:hover,
.zv-icon-cluster.cluster-3 .cluster-link:focus-visible,
.zv-icon-cluster.cluster-2 .cluster-link:hover,
.zv-icon-cluster.cluster-2 .cluster-link:focus-visible {
    transform: translateY(-5px);
}

.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n+2):hover,
.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n+2):focus-visible,
.zv-icon-cluster.cluster-2 .cluster-link:nth-child(2n):hover,
.zv-icon-cluster.cluster-2 .cluster-link:nth-child(2n):focus-visible {
    transform: translateY(11px);
}

.zv-icon-cluster.cluster-3 .cluster-link .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link .cluster-tip {
    left: 50%;
    right: auto;
    transform: translate(-50%, 4px);
}

.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n+1) .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link:nth-child(2n+1) .cluster-tip {
    left: 0;
    transform: translate(0, 4px);
}

.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n) .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link:nth-child(2n) .cluster-tip {
    left: auto;
    right: 0;
    transform: translate(0, 4px);
}

.zv-icon-cluster.cluster-3 .cluster-link:hover .cluster-tip,
.zv-icon-cluster.cluster-3 .cluster-link:focus-visible .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link:hover .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link:focus-visible .cluster-tip {
    transform: translate(-50%, 0);
}

.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n+1):hover .cluster-tip,
.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n+1):focus-visible .cluster-tip,
.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n):hover .cluster-tip,
.zv-icon-cluster.cluster-3 .cluster-link:nth-child(3n):focus-visible .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link:hover .cluster-tip,
.zv-icon-cluster.cluster-2 .cluster-link:focus-visible .cluster-tip {
    transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
    .cluster-link,
    .cluster-tip {
        transition: none;
    }

        .cluster-link:hover,
        .cluster-link:focus-visible {
            transform: none !important;
        }
}

/* ---------- Home: Sheet with the tools, Band with the services ---------- */

.sheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
}

    .sheet-head .zv-heading,
    .services .zv-heading,
    .about .zv-heading {
        font-size: 26px;
    }

.sheet-note {
    font-size: 14px;
    color: var(--ink-muted);
}

.section-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .section-head .zv-section-lead {
        font-size: 16px;
    }

.services {
    gap: var(--space-5);
}

.tile-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.badge-new {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
}

.coming {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 15px;
}

    .coming a {
        font-weight: 600;
    }

.search-empty {
    color: var(--ink-muted);
}

/* ---------- Home: customers, about, contact ---------- */

.customers {
    align-items: center;
    text-align: center;
    gap: var(--space-5);
}

    .customers h2 {
        color: var(--ink-muted);
    }

    .customers ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-4) 40px;
        font-size: 20px;
        font-weight: 700;
        color: var(--ink-muted);
        letter-spacing: -0.01em;
    }

.about {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6) 64px;
    align-items: flex-start;
}

.about-text {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

    .about-text p {
        font-size: 17px;
        line-height: 1.6;
    }

.about-facts {
    flex: 1 1 320px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-6);
}

.contact-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.zv-facts dd a {
    overflow-wrap: anywhere;
}

.news {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4) var(--space-5);
}

.news-text {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

    .news-text .zv-card-title {
        font-size: 18px;
    }

    .news-text p {
        font-size: 14px;
        color: var(--ink-muted);
    }

@media (max-width: 760px) {
    .zv-chrome-hero-inner {
        padding: 36px var(--space-4) 128px;
        gap: 28px;
    }

    .zv-chrome-hero-lead {
        font-size: 17px;
    }

    .site-main-home > .zv-section,
    .zv-band > .zv-section {
        padding: 0 var(--space-3);
    }

    .zv-sheet {
        gap: 28px;
    }

    .zv-app-tile {
        flex-direction: row;
        align-items: center;
        padding: 14px var(--space-4);
        gap: 14px;
    }

        .zv-app-tile .zv-app-icon {
            width: 44px;
            height: 44px;
            border-radius: var(--radius-md);
        }

            .zv-app-tile .zv-app-icon svg {
                width: 22px;
                height: 22px;
            }

    .zv-app-tile-desc {
        font-size: 15px;
        line-height: 21px;
    }

    .zv-band {
        padding: var(--space-7) 0;
    }

    .zv-cta {
        padding: 28px 22px;
    }

        .zv-cta h2 {
            font-size: 23px;
        }

        .zv-cta .zv-btn {
            width: 100%;
        }
}

/* ---------- Privacy policy and terms ---------- */

.narrow {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.legal {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

    .legal section {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }

    .legal h2 {
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
    }

    .legal h3 {
        font-size: 17px;
        font-weight: 700;
    }

    .legal p,
    .legal li {
        font-size: 16px;
        line-height: 1.65;
    }

    .legal ul {
        margin: 0;
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }

    .legal .small {
        font-size: 15px;
    }

.legal-intro {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .legal-intro h1 {
        font-size: 40px;
        line-height: 1.1;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .legal-intro .lead {
        font-size: 19px;
        line-height: 1.6;
        color: var(--ink-muted);
    }

.legal-updated {
    font-size: 14px;
    color: var(--ink-muted);
}

.legal-toc {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-6);
}

    .legal-toc ol {
        margin: 0;
        padding-left: var(--space-5);
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
    }

.legal-toc-title {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-muted);
}

.legal .legal-app {
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

    .legal-app > div {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

.legal-app-head {
    flex-direction: row !important;
    align-items: center;
    gap: var(--space-3) !important;
}

    /* App names are one long word ("PasswordGenerator"); on a 320px phone they must break rather than widen the page. */
    .legal-app-head h2 {
        min-width: 0;
        overflow-wrap: anywhere;
    }

/* Text that is not decided yet. Visible on purpose, so it is filled in before the page is published. */
.placeholder {
    background: var(--warning-soft);
    color: var(--ink);
    border-radius: 4px;
    padding: 0 4px;
}

@media (max-width: 600px) {
    .legal-intro h1 {
        font-size: 32px;
    }
}

/* Error and 404 pages */

.page-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.page-intro {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .page-intro h1 {
        font-size: 36px;
        line-height: 42px;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

.lead {
    font-size: 18px;
    line-height: 28px;
    color: var(--ink-muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
}

/* Support page (Pages/Support.razor): the legal pages' column with a form. */

.support {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.support-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

    .support-section h2 {
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
    }

    .support-section p,
    .support-section li {
        font-size: 16px;
        line-height: 1.65;
    }

    .support-section ul {
        margin: 0;
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }

.support-form {
    gap: var(--space-5);
    margin-top: var(--space-2);
}

.support-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-5);
}

select.zv-input {
    cursor: pointer;
}

textarea.zv-input {
    height: auto;
    min-height: 140px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

.zv-notice-body {
    margin: 0;
    padding-left: 18px;
}

/* Hidden from people; bots that fill in every field fill in this one too. */
.support-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.support-receipt {
    margin-top: var(--space-2);
}

.support-section ul.support-apps {
    list-style: none;
    padding: 0;
    gap: 0;
    border-top: 1px solid var(--line);
}

    .support-apps li {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-2) var(--space-3);
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--line);
    }

.support-app-name {
    flex: 1 1 auto;
    font-weight: 700;
}

.support-app-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.support-apps a {
    font-weight: 600;
}
