/*
 * PasswordGenerator'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 mockup has that the components lack. The generator's own
 * styles are in PasswordGenerator.Client/Tool/PasswordTool.razor.css. 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%;
}

h1, h2, h3 {
    margin: 0;
}

h1:focus, [tabindex="-1"]:focus {
    outline: none;
}

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);
}

/* Icons (PasswordGenerator.Client/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-sm {
    width: 16px;
    height: 16px;
}

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

.zv-feature-icon .icon {
    width: 22px;
    height: 22px;
}

/* Error and 404 pages: one narrow column. */

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

.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);
}

/* Home page: sections page-max wide, space-9 apart (the mockup's 56px top and 88px bottom). */

.home {
    display: flex;
    flex-direction: column;
    gap: var(--space-9);
    padding-top: calc(56px - var(--space-7));
    padding-bottom: calc(var(--space-9) - 56px);
}

.zv-hero, .zv-section {
    width: 100%;
}

/* Hero: the text on the left, the generator on the right (below on narrow screens). */
.pg-hero {
    align-items: flex-start;
}

.pg-hero-text {
    flex: 1 1 400px;
    padding-top: var(--space-3);
}

.pg-hero-text .zv-hero-lead {
    max-width: 520px;
}

.pg-hero-tool {
    flex: 1 1 400px;
    min-width: 0;
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

.pg-tool-notice {
    margin-top: var(--space-4);
}

.pg-tool-notice[hidden] {
    display: none;
}

.zv-notice .icon {
    width: 22px;
    height: 22px;
}

.zv-notice .zv-notice-body {
    font-size: 15px;
    line-height: 1.5;
}

.pg-share {
    margin: var(--space-4) var(--space-1) 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 15px;
    color: var(--ink-muted);
}

    .pg-share a {
        font-weight: 600;
    }

.zv-cta .zv-btn-primary {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .home {
        gap: var(--space-8);
        padding-top: 0;
    }

    .page-intro h1 {
        font-size: 30px;
        line-height: 36px;
    }

    .zv-compare {
        padding: var(--space-5);
    }

    .zv-cta {
        padding: var(--space-6) var(--space-5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .zv-faq summary svg {
        transition: none;
    }
}

/* Blazor */

#blazor-error-ui {
    background: var(--warning-soft);
    color: var(--ink);
    border-top: 1px solid var(--warning-line);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* The tool's script shows and hides parts with the hidden attribute; a component that sets display must not
   override it. */
[hidden] {
    display: none !important;
}

/* "Lösenordsgenerator:" is one long word: at the design system's phone size (36 px) it is wider than a 360 px
   screen leaves for the heading, so the page scrolled sideways. Scaled with the screen up to 36 px. */
@media (max-width: 420px) {
    :lang(sv) .pg-hero .zv-hero-title {
        font-size: min(36px, 8.6vw);
    }
}

/* Home page: the guides under the questions (Pages/Index.razor). */
.home-guides {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .home-guides h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
    }

    .home-guides ul {
        margin: 0;
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        font-size: 16px;
        line-height: 1.5;
    }

    .home-guides a {
        font-weight: 600;
    }

/* Guides (Guides/GuideArticle.razor): one readable column with breadcrumbs, the text, the questions, the button and
   the links under it. */
.guide-page {
    padding: var(--space-7) 0 var(--space-8);
}

.guide {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.guide-crumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--ink-muted);
}

    .guide-crumbs li + li::before {
        content: "›";
        margin-right: var(--space-2);
    }

.guide-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    hyphens: auto;
}

.guide-prose {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    font-size: 17px;
    line-height: 1.7;
}

    .guide-prose > * {
        margin: 0;
    }

    .guide-prose h2 {
        margin-top: var(--space-5);
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    .guide-prose ul,
    .guide-prose ol {
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }

/* The tables wrap their text to fit a phone; should a long word not fit, the table scrolls sideways inside its frame,
   never the page. */
.guide-tablewrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

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

    .guide-tablewrap table {
        width: 100%;
        border-collapse: collapse;
        font-size: 15px;
        line-height: 1.55;
    }

    .guide-tablewrap thead th,
    .guide-tablewrap thead td {
        text-align: left;
        font-size: 13px;
        font-weight: 700;
        color: var(--ink-muted);
        padding: 10px 12px;
        border-bottom: 1px solid var(--line-control);
        background: var(--surface-sunken);
    }

    .guide-tablewrap tbody th,
    .guide-tablewrap tbody td {
        text-align: left;
        vertical-align: top;
        padding: 12px;
        overflow-wrap: break-word;
        hyphens: auto;
        border-bottom: 1px solid var(--line);
    }

    .guide-tablewrap tbody th {
        font-weight: 700;
    }

    .guide-tablewrap tbody tr:last-child th,
    .guide-tablewrap tbody tr:last-child td {
        border-bottom: none;
    }

.guide-faq {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

    .guide-faq h2 {
        margin: 0;
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
    }

.guide-end {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.guide-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

.guide-button p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-muted);
}

.guide-more {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 16px;
}

    /* "Sending the password to someone else? SecureShare": the question in body weight, the links stand out. */
    .guide-more a {
        font-weight: 600;
    }

@media (max-width: 600px) {
    .guide-title {
        font-size: 30px;
    }

    .guide-tablewrap thead th,
    .guide-tablewrap thead td,
    .guide-tablewrap tbody th,
    .guide-tablewrap tbody td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .guide-prose {
        font-size: 16px;
    }
}
