/* =================================================================
   Viver Legal — Otack CMS template
   Custom styles & utilities not easily handled by pure Tailwind
   ================================================================= */

html, body { overflow-x: hidden; width: 100%; }
html { overscroll-behavior-y: none; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #FAF8F3;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-attachment: fixed;
}

/* Sticky header transitions */
.header-transparent { background-color: transparent; color: white; border-bottom: 1px solid transparent; }
.header-scrolled { background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); color: #0F2846; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.header-transparent #mobile-menu-btn { color: #ffffff; }
.header-scrolled #mobile-menu-btn { color: #0F2846; }

/* Outline link hover toggle */
.header-transparent .nav-link-hover { position: relative; }
.header-transparent .nav-link-hover:hover { color: #94CC57; }
.header-scrolled .nav-link-hover:hover { color: #7DBA3C; }

/* Focus rings for a11y */
*:focus-visible { outline: 2px solid #7DBA3C; outline-offset: 2px; }

/* Hero text underline SVG alignment */
.drawn-underline { bottom: -0.2em; left: -2%; width: 104%; height: 0.4em; z-index: -1; }

/* Hero stock background image + navy 78% overlay */
.hero-bg-image {
    background-image: url('/assets/images/hero_bg.jpg');
    background-size: cover;
    background-position: center;
}
.hero-overlay { background-color: rgba(15, 40, 70, 0.78); }

/* Cream section — same noise treatment as body, viewport-anchored (no seam) */
.bg-cream-noise {
    background-color: #FAF8F3;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-attachment: fixed;
}

/* Shimmer / mirror-gleam effect for primary CTA */
.btn-shimmer { position: relative; overflow: hidden; isolation: isolate; }
.btn-shimmer > * { position: relative; z-index: 1; }
.btn-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60%; height: 100%;
    background: linear-gradient(110deg,
        transparent 20%,
        rgba(255,255,255,0.0) 40%,
        rgba(255,255,255,0.55) 50%,
        rgba(255,255,255,0.0) 60%,
        transparent 80%);
    transform: translateX(-120%) skewX(-18deg);
    animation: btn-shimmer-sweep 3.8s cubic-bezier(.4,0,.2,1) infinite;
    animation-delay: 1.2s;
    pointer-events: none;
    z-index: 0;
}
@keyframes btn-shimmer-sweep {
    0%   { transform: translateX(-120%) skewX(-18deg); }
    55%  { transform: translateX(260%)  skewX(-18deg); }
    100% { transform: translateX(260%)  skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-shimmer::before { animation: none; display: none; }
}

/* CMS-rendered form (FormRenderer) — restyle to match Viver Legal palette */
.contact .nwl-form-wrap { width: 100%; }
/* 2-column grid on md+ for email + phone side by side, full-width otherwise */
.contact .nwl-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.contact .nwl-form > .nwl-form-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.25rem; }
.contact .nwl-form > .nwl-form-field:has(input[name="email"]),
.contact .nwl-form > .nwl-form-field:has(input[name="phone"]) {
    grid-column: span 1;
}
.contact .nwl-form > button,
.contact .nwl-form > .nwl-form-message,
.contact .nwl-form > .nwl-form-error { grid-column: 1 / -1; }
@media (max-width: 640px) {
    .contact .nwl-form { grid-template-columns: 1fr; }
    .contact .nwl-form > .nwl-form-field:has(input[name="email"]),
    .contact .nwl-form > .nwl-form-field:has(input[name="phone"]) {
        grid-column: 1;
    }
}
.contact .nwl-form-field--required label::after { content: ''; }
.contact .nwl-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #14365F;
}
.contact .nwl-form input[type="text"],
.contact .nwl-form input[type="email"],
.contact .nwl-form input[type="tel"],
.contact .nwl-form select,
.contact .nwl-form textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #F4F6F8;
    border: 1px solid #C9D0D8;
    border-radius: 2px;
    font-family: inherit;
    font-size: 1rem;
    color: #0F2846;
    transition: background .2s, border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
}
.contact .nwl-form input:focus,
.contact .nwl-form select:focus,
.contact .nwl-form textarea:focus {
    background: #ffffff;
    border-color: #7DBA3C;
    outline: none;
    box-shadow: 0 0 0 3px rgba(125,186,60,.18);
}
.contact .nwl-form textarea { resize: vertical; min-height: 6rem; }
.contact .nwl-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: rgba(20,54,95,.75);
    line-height: 1.6;
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}
.contact .nwl-checkbox input {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    accent-color: #6BA331;
    margin: 0.2rem 0 0 0;
}
.contact .nwl-checkbox__text { flex: 1; }
.contact .nwl-checkbox a {
    color: #4E7B1E;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.contact .nwl-checkbox a:hover { color: #6BA331; }
.contact .nwl-form .nwl-btn,
.contact .nwl-form button[type="submit"] {
    margin-top: 0.5rem;
    padding: 0.85rem 1rem;
    background: #4E7B1E;
    color: #ffffff;
    font-weight: 500;
    font-size: 1rem;
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
}
.contact .nwl-form .nwl-btn:hover,
.contact .nwl-form button[type="submit"]:hover {
    background: #6BA331;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(15,40,70,.08);
}
.contact .nwl-form-success-text { color: #0F2846; }
.contact .nwl-form-error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

/* Legal page hero — accent-green banner */
.legal-hero {
    background: linear-gradient(135deg, #4E7B1E 0%, #6BA331 60%, #7DBA3C 100%);
}
.legal-hero__pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><defs><pattern id='p' x='0' y='0' width='60' height='60' patternUnits='userSpaceOnUse'><circle cx='30' cy='30' r='1.5' fill='white' opacity='0.18'/></pattern></defs><rect width='100%25' height='100%25' fill='url(%23p)'/></svg>");
    opacity: 0.6;
    pointer-events: none;
}
.legal-hero h1 {
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Legal page (Polityka prywatności / Regulamin) — long-form text styling */
.legal-page .legal-content {
    color: rgba(20, 54, 95, 0.85);
    font-size: 1rem;
    line-height: 1.75;
}
.legal-page .legal-content p { margin-bottom: 1rem; }
.legal-page .legal-content p strong {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    color: #0F2846;
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.legal-page .legal-content > p:first-child > strong:only-child { display: none; }
.legal-page .legal-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.legal-page .legal-content ul li {
    margin-bottom: 0.4rem;
}
.legal-page .legal-content ul li p {
    margin-bottom: 0;
}
.legal-page .legal-content a {
    color: #4E7B1E;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legal-page .legal-content a:hover { color: #6BA331; }

/* Privacy notice below contact form */
.contact .form-privacy-notice {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    background: rgba(125, 186, 60, 0.08);
    border-left: 3px solid #7DBA3C;
    font-size: 0.875rem;
    color: rgba(20, 54, 95, 0.8);
    line-height: 1.6;
}
.contact .form-privacy-notice a {
    color: #4E7B1E;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.contact .form-privacy-notice a:hover { color: #6BA331; }

/* Cookie banner — flatten inline icon+text into a 2-column flex layout
   (CookieConsentRenderer renders icon span as inline element inside <p>,
   so text wraps around it; this turns the <p> into a flex row). */
#nwl-cookie-banner > div > p {
    display: flex !important;
    align-items: center;
    gap: 0.875rem;
    line-height: 1.55;
}
#nwl-cookie-banner > div > p > span:first-child {
    margin-right: 0 !important;
    align-self: center;
}

/* Lang switcher (CMS HeadBuilder-rendered) */
.lang-switcher { display: inline-flex; align-items: center; gap: 0.5rem; }
.lang-switcher__link, .lang-btn {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    color: inherit;
    opacity: 0.7;
    transition: opacity .2s;
}
.lang-switcher__link:hover, .lang-btn:hover { opacity: 1; }
.lang-switcher__link--active, .lang-btn.active { opacity: 1; color: #7DBA3C; }

/* ==========================================================================
   MenuRenderer adapter — flatten its <nav><ul><li> output so its anchors
   become direct flex children of the surrounding nav/wrapper, matching the
   original lorica-landing markup where each <a> was a sibling.
   ========================================================================== */
#site-header nav nav,
#site-header nav nav ul,
#site-header nav nav li,
#mobile-drawer nav nav,
#mobile-drawer nav nav ul,
#mobile-drawer nav nav li {
    display: contents;
}

/* Header desktop nav links — match original sizing/hover */
#site-header nav nav a {
    transition: color .2s ease;
}
#site-header.header-transparent nav nav a:hover { color: #94CC57; }
#site-header.header-scrolled nav nav a:hover { color: #7DBA3C; }

/* Mobile drawer links — original had border-b border-white/10 pb-4 */
#mobile-drawer nav nav a {
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

/* Footer nav links */
.footer-nav-col nav, .footer-nav-col nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-nav-col nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer-nav-col nav a {
    display: inline-block;
    padding: 0.25rem 0;
    color: #C9D0D8;
    transition: color .2s ease;
    font-size: 0.875rem;
}
.footer-nav-col nav a:hover { color: #7DBA3C; }

/* Site header — fix site-header class so transparent/scrolled work via id */
.site-header { /* no-op marker class */ }

/* Hamburger button color tied to header state (already in id selectors above) */
