/* Shared public-site styles: header + homepage. Same tokens as footer.css / authModal.css. */
:root {
    --site-ink: #26211d;
    --site-muted: #574f48;
    --site-line: #e4ddd5;
    --site-accent: #730b09;
    --site-accent-dark: #5a0807;
    --site-accent-soft: #f6eceb;
    --site-header-h: 80px;
}
@media (max-width: 991.98px) {
    :root {
        --site-header-h: 68px;
    }
}

/* ---------- Header ---------- */
.site-header {
    --default-color: var(--site-ink);
    --heading-color: var(--site-ink);

    height: var(--site-header-h);
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--site-ink);
    background-color: #fff;
    border-top: 4px solid var(--site-accent);
    border-bottom: 1px solid var(--site-line);
    transition: box-shadow .2s ease;
}
.scrolled .site-header {
    box-shadow: 0 2px 14px rgba(38, 33, 29, .08);
}
.site-header :focus-visible {
    outline: 2px solid var(--site-accent);
    outline-offset: 2px;
}
.site-header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}
.site-logo {
    flex: 0 0 auto;
    line-height: 0;
}
.site-logo img {
    max-height: 52px;
}
.site-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}

/* Language switcher */
.site-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    height: 40px;
    padding: 0 .7rem;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: #fff;
    color: var(--site-ink);
    font-size: .85rem;
    font-weight: 600;
}
.site-lang-toggle:hover {
    border-color: #cfc5ba;
}
.site-lang-toggle img {
    border-radius: 2px;
}
.site-lang-toggle .bi {
    font-size: .7rem;
    color: var(--site-muted);
}
.site-lang-menu {
    min-width: 11rem;
    padding: .35rem;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(38, 33, 29, .12);
}
.site-lang-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    border-radius: 4px;
    font-size: .9rem;
    color: var(--site-ink);
}
.site-lang-menu .dropdown-item:hover {
    background: #f4f2ef;
    color: var(--site-ink);
}
.site-lang-menu .dropdown-item.active {
    background: var(--site-accent-soft);
    color: var(--site-accent);
    font-weight: 600;
}

/* Header buttons */
.site-btn,
.site-btn:focus {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 40px;
    padding: 0 1rem;
    border-radius: 6px;
    background: var(--site-accent);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s ease;
}
.site-btn:hover {
    background: var(--site-accent-dark);
    color: #fff;
}
.site-logout {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    color: var(--site-ink);
}
.site-logout:hover {
    border-color: var(--site-accent);
    color: var(--site-accent);
}

@media (max-width: 991.98px) {
    .site-logo img {
        max-height: 42px;
    }
}
@media (max-width: 575.98px) {
    .site-header-inner {
        gap: .75rem;
    }
    .site-actions {
        gap: .5rem;
    }
    .site-logo img {
        max-height: 36px;
    }
    .site-btn {
        width: 40px;
        padding: 0;
        justify-content: center;
    }
    .site-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .site-lang-toggle .bi {
        display: none;
    }
}

/* Spacer under the fixed header on subpages */
.site-header-spacer {
    height: var(--site-header-h);
}

/* ---------- Homepage ---------- */
.home-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(78vh, 680px);
    padding: calc(var(--site-header-h) + 4rem) 0 9rem;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(100deg, rgba(36, 8, 7, .94) 0%, rgba(58, 10, 9, .86) 42%, rgba(58, 10, 9, .35) 100%),
        url("../theme/img/foto-knizky.jpg?v1.0") center / cover no-repeat;
    isolation: isolate;
}
.home-hero::after {
    /* soft fade into the page under the quick links */
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: -1;
    height: 40%;
    background: linear-gradient(to top, rgba(36, 8, 7, .45), transparent);
}
.home-hero-content {
    max-width: 40rem;
}
.home-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 1.25rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #f3c27a;
}
.home-hero-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: currentColor;
}
.home-hero-title {
    margin: 0 0 1.25rem;
    font-family: var(--heading-font, "Raleway", sans-serif);
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.01em;
    color: #fff;
}
.home-hero-lead {
    max-width: 34rem;
    margin: 0 0 2rem;
    font-size: 1.15rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .85);
}
.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.home-btn,
.home-btn:focus {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 50px;
    padding: .75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.home-btn:focus-visible {
    outline: 3px solid #f3c27a;
    outline-offset: 3px;
}
.home-btn-primary,
.home-btn-primary:focus {
    background: #fff;
    color: var(--site-accent);
}
.home-btn-primary:hover {
    background: #fff;
    color: var(--site-accent-dark);
    transform: translateY(-1px);
}
.home-btn-ghost,
.home-btn-ghost:focus {
    border-color: rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .06);
    color: #fff;
}
.home-btn-ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, .14);
    color: #fff;
}
.home-btn-ghost .bi {
    transition: transform .15s ease;
}
.home-btn-ghost:hover .bi {
    transform: translateX(3px);
}
/* Quick links over the bottom of the hero */
.home-quick {
    position: relative;
    z-index: 2;
    margin-top: -5.5rem;
    padding: 0;
    overflow: visible;
    background: none;
}
.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.home-quick-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    height: 100%;
    padding: 1.6rem 1.5rem;
    border: 1px solid var(--site-line);
    border-radius: 12px;
    background: #fff;
    color: var(--site-ink);
    box-shadow: 0 14px 40px rgba(38, 33, 29, .12);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.home-quick-card:hover {
    border-color: #d8c4c2;
    color: var(--site-ink);
    box-shadow: 0 18px 44px rgba(38, 33, 29, .16);
    transform: translateY(-3px);
}
.home-quick-card:focus-visible {
    outline: 3px solid var(--site-accent);
    outline-offset: 3px;
}
.home-quick-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--site-accent-soft);
    color: var(--site-accent);
    font-size: 1.4rem;
    transition: background-color .2s ease, color .2s ease;
}
.home-quick-card:hover .home-quick-icon {
    background: var(--site-accent);
    color: #fff;
}
.home-quick-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
}
.home-quick-title {
    margin: 0;
    font-family: var(--heading-font, "Raleway", sans-serif);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--site-ink);
    transition: color .15s ease;
}
.home-quick-card:hover .home-quick-title {
    color: var(--site-accent);
}
.home-quick-text {
    font-size: .93rem;
    line-height: 1.55;
    color: var(--site-muted);
}
.home-quick-arrow {
    align-self: center;
    flex-shrink: 0;
    color: var(--site-accent);
    font-size: 1.15rem;
    transition: transform .2s ease;
}
.home-quick-card:hover .home-quick-arrow {
    transform: translateX(4px);
}

.home-content {
    padding-top: 5rem;
}

/* Subpages with content blocks (Home/faq, prepareToTest, …) – the page title in .legal-head like the legal pages */
.page-content {
    padding: 2.5rem 0 5rem;
}

@media (max-width: 991.98px) {
    .home-quick-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 36rem;
    }
    .home-hero {
        padding-bottom: 7rem;
    }
    .home-content {
        padding-top: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-btn,
    .home-btn .bi,
    .home-quick-card,
    .home-quick-arrow {
        transition: none;
    }
    .home-btn:hover,
    .home-quick-card:hover,
    .home-quick-card:hover .home-quick-arrow {
        transform: none;
    }
}

/* ---------- Legal pages (privacy / cookies) ---------- */
.legal-page {
    --default-color: var(--site-ink);
    padding: 2.5rem 0 4.5rem;
    color: var(--site-ink);
}
.legal-head {
    padding-bottom: 1.75rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--site-line);
}
.legal-eyebrow {
    margin: 0 0 .4rem;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--site-accent);
}
.legal-head h1 {
    margin: 0 0 .5rem;
    font-family: var(--heading-font, "Raleway", sans-serif);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--site-ink);
}
.legal-meta {
    margin: 0;
    color: var(--site-muted);
}

/* Table of contents */
.legal-toc {
    position: sticky;
    top: calc(var(--site-header-h) + 1.5rem);
    margin-bottom: 2rem;
    padding: 1.25rem 1.25rem 1rem;
    background: #f4f2ef;
    border-radius: 6px;
}
.legal-toc-title {
    margin: 0 0 .75rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--site-line);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    color: var(--site-ink);
}
.legal-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}
.legal-toc li {
    counter-increment: toc;
}
.legal-toc a {
    display: flex;
    gap: .5rem;
    padding: .4rem .6rem;
    margin: 0 -.6rem;
    border-left: 2px solid transparent;
    font-size: .9rem;
    line-height: 1.4;
    color: var(--site-ink);
    text-decoration: none;
}
.legal-toc a::before {
    content: counter(toc) ".";
    flex: 0 0 1.25rem;
    color: var(--site-muted);
}
.legal-toc a:hover {
    color: var(--site-accent);
}
.legal-toc a.active {
    border-left-color: var(--site-accent);
    background: #fff;
    color: var(--site-accent);
    font-weight: 600;
}

/* Document body */
.legal-body {
    max-width: 50rem;
    font-size: 1rem;
    line-height: 1.75;
}
.legal-section {
    padding: 0;
    overflow: visible;
    background: none;
    scroll-margin-top: calc(var(--site-header-h) + 1.5rem);
}
.legal-section + .legal-section {
    margin-top: 2.75rem;
}
.legal-section h2 {
    margin: 0 0 1rem;
    font-family: var(--heading-font, "Raleway", sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--site-ink);
}
.legal-num {
    color: var(--site-accent);
}
.legal-body p,
.legal-body ul {
    margin-bottom: 1rem;
    color: var(--site-ink);
}
.legal-body ul {
    padding-left: 1.25rem;
}
.legal-body li + li {
    margin-top: .25rem;
}
.legal-body a {
    color: var(--site-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}
.legal-body a:hover {
    color: var(--site-accent-dark);
}
.legal-callout {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--site-accent);
    border-radius: 0 6px 6px 0;
    background: #f4f2ef;
}
.legal-callout ul {
    margin: .5rem 0 0;
}
.legal-signoff {
    font-weight: 700;
}

/* Tables */
.legal-table {
    margin: 1.25rem 0 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--site-line);
    border-radius: 6px;
}
.legal-table table {
    width: 100%;
    min-width: 32rem;
    border-collapse: collapse;
    font-size: .95rem;
    line-height: 1.6;
}
.legal-table th,
.legal-table td {
    padding: .75rem 1rem;
    color: var(--site-ink);
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--site-line);
}
.legal-table thead th {
    border-top: 0;
    background: #f4f2ef;
    font-weight: 700;
}
.legal-table tbody th {
    font-weight: 600;
}
.legal-table td p:last-child {
    margin-bottom: 0;
}

/* Consent withdrawal: preview of the bottom bar + direct button */
.legal-figure {
    margin: 1.25rem 0 1rem;
}
.legal-figure-bar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    padding: .8rem 1.1rem;
    border-radius: 6px;
    background: var(--site-accent);
    color: #fff;
    font-size: .8rem;
}
.legal-figure-links {
    display: flex;
    gap: 1.25rem;
}
.legal-figure-links .is-highlighted {
    padding: 0 .4rem;
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: 2px;
}
.legal-figure figcaption {
    margin-top: .4rem;
    font-size: .85rem;
    color: var(--site-muted);
}
.legal-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 44px;
    padding: 0 1.1rem;
    border: 1px solid var(--site-accent);
    border-radius: 6px;
    background: #fff;
    color: var(--site-accent);
    font-weight: 600;
    transition: background-color .15s ease, color .15s ease;
}
.legal-btn:hover {
    background: var(--site-accent);
    color: #fff;
}

@media (max-width: 991.98px) {
    .legal-toc {
        position: static;
    }
    .legal-head h1 {
        font-size: 1.75rem;
    }
}

/* ---------- Contact page ---------- */
.contact-page {
    --default-color: var(--site-ink);
    padding: 2.5rem 0 4.5rem;
    color: var(--site-ink);
}
.contact-card {
    height: 100%;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--site-line);
    border-top: 3px solid var(--site-accent);
    border-radius: 6px;
    background: #fff;
}
.contact-card-title {
    margin: 0 0 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--site-line);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    color: var(--site-ink);
}
.contact-address {
    margin: 0 0 1.25rem;
    font-style: normal;
    line-height: 1.75;
}
.contact-address strong {
    font-weight: 600;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 600;
    color: var(--site-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.contact-link:hover {
    color: var(--site-accent-dark);
}
.contact-link i {
    font-size: .8rem;
}

.contact-map {
    height: 100%;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: #f4f2ef;
}
.contact-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: 0;
}
.contact-map-placeholder {
    height: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 2rem 1.5rem;
    text-align: center;
}
.contact-map-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--site-accent-soft);
    color: var(--site-accent);
    font-size: 1.5rem;
}
.contact-map-address {
    margin: 0 0 .25rem;
    font-weight: 600;
}
.contact-map-notice {
    max-width: 30rem;
    margin: .25rem 0 0;
    font-size: .85rem;
    color: var(--site-muted);
}

/* ---------- Phones: denser scale ----------
   rem-based sizes (Bootstrap, our own components) shrink via the root font size; the theme's px values are
   overridden one by one below. Form fields stay at 16px – smaller makes iOS Safari zoom in on focus. */
@media (max-width: 575.98px) {
    :root {
        --site-header-h: 58px;
    }
    html {
        font-size: 15px;
    }
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px;
    }

    .site-logo img {
        max-height: 30px;
    }
    .site-lang-toggle,
    .site-btn,
    .site-logout {
        height: 36px;
    }
    .site-btn,
    .site-logout {
        width: 36px;
    }

    section,
    .section {
        padding: 32px 0;
    }
    .section-title {
        padding-bottom: 28px;
    }
    .section-title h2 {
        font-size: 24px;
        margin-bottom: 12px;
        padding-bottom: 14px;
    }
    .section-title h2::before {
        width: 110px;
    }
    .section-title h2::after {
        width: 44px;
    }

    .home-hero {
        min-height: 0;
        padding: calc(var(--site-header-h) + 2.5rem) 0 6.5rem;
        background-position: 70% center;
    }
    .home-hero-lead {
        margin-bottom: 1.5rem;
        font-size: 1rem;
    }
    .home-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .home-btn,
    .home-btn:focus {
        justify-content: center;
    }
    .home-quick {
        margin-top: -4.5rem;
    }
    .home-quick-grid {
        gap: .75rem;
    }
    .home-quick-card {
        padding: 1.1rem 1.1rem;
        box-shadow: 0 8px 22px rgba(38, 33, 29, .1);
    }
    .home-quick-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    .home-quick-title {
        font-size: 1.08rem;
    }
    .home-content {
        padding-top: 2.5rem;
    }
    .page-content {
        padding: 1.5rem 0 3rem;
    }

    .legal-page,
    .contact-page {
        padding: 1.5rem 0 2.5rem;
    }
    .legal-head {
        padding-bottom: 1.1rem;
        margin-bottom: 1.5rem;
    }
    .legal-head h1 {
        font-size: 1.5rem;
    }
    .legal-section + .legal-section {
        margin-top: 2rem;
    }
    .legal-section h2 {
        font-size: 1.2rem;
    }
    .contact-card {
        padding: 1.1rem 1.15rem;
    }
    .contact-map,
    .contact-map iframe,
    .contact-map-placeholder {
        min-height: 260px;
    }
}
