/* ============================================================
   WaszNowyDom – Custom Design System
   ============================================================ */

:root {
    --primary: #C0392B;
    --primary-dark: #96281B;
    --secondary: #2C3E50;
    --accent: #E67E22;
    --light: #FDFAF6;
    --dark: #1A1A2E;
    --muted: #6c757d;
    --card-bg: #ffffff;
    --body-bg: #FDFAF6;
    --nav-bg: #ffffff;
    --border: #e9ecef;

    --font-main: 'Lato', sans-serif;
    --font-heading: 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-scale: 1;

    --radius: 12px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, .08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .14);
    --transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

/* Dark theme */
[data-theme="dark"] {
    --body-bg: #0e0e1a;
    --card-bg: #1a1a2e;
    --nav-bg: #12121f;
    --dark: #e8e8f0;
    --muted: #9090a8;
    --border: #2a2a3e;
    --light: #1a1a2e;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-secondary {
    color: var(--muted) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--dark) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--card-bg) !important;
    color: var(--dark);
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .card {
    background-color: var(--body-bg) !important;
    color: var(--dark);
}

[data-theme="dark"] .card-feature {
    background-color: var(--card-bg) !important;
    border-color: var(--border) !important;
}

/* Forms in Dark Mode */
[data-theme="dark"] .form-label {
    color: var(--dark) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #2a2a3e !important;
    border-color: #3f3f5a !important;
    color: #e8e8f0 !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: #9090a8 !important;
}

.search-box-container {
    background: rgba(255, 255, 255, 0.95);
    color: #212529;
}

[data-theme="dark"] .search-box-container {
    background: rgba(26, 26, 46, 0.8) !important;
    color: var(--dark) !important;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================
   BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--body-bg);
    color: var(--dark);
    font-size: calc(1rem * var(--font-scale));
    line-height: 1.7;
    transition: background-color .35s ease, color .35s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: -.01em;
}

.letter-spacing {
    letter-spacing: .08em;
}

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: .6rem 1.2rem;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 700;
    transition: top .2s;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.site-header {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
}

/* Sticky scrolled state – dodawane przez JS */
.site-header.scrolled {
    background: rgba(18, 18, 31, 0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(192, 57, 43, 0.4) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
}

.site-header.scrolled .nav-link,
.site-header.scrolled .navbar-brand .logo-wasz,
.site-header.scrolled .navbar-brand .logo-dom {
    color: #e8e8f0;
}

.site-header.scrolled .nav-pill:hover {
    background: rgba(192, 57, 43, .18);
    color: #fff;
}

.site-header.scrolled .navbar-toggler {
    color: #fff;
    border-color: rgba(255, 255, 255, .3);
}

/* Logo */
.logo-brand {
    font-family: var(--font-heading);
    text-decoration: none;
    font-size: 1.5rem;
}

.logo-wasz {
    color: var(--secondary);
    font-weight: 700;
}

.logo-nowy {
    color: var(--primary);
    font-weight: 700;
}

.logo-dom {
    color: var(--accent);
    font-weight: 400;
    font-style: italic;
}

/* Nav links */
.nav-pill {
    border-radius: 20px;
    padding: .4rem 1rem;
    color: var(--secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-pill:hover,
.nav-pill.active {
    background: rgba(192, 57, 43, .09);
    color: var(--primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-praga {
    background: #C0392B !important;
    color: #fff !important;
    border: 2px solid #C0392B !important;
    border-radius: 25px;
    font-weight: 600;
    padding: .55rem 1.6rem;
    transition: var(--transition);
    letter-spacing: .02em;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.btn-praga:hover,
.btn-praga:focus {
    background: #96281B !important;
    border-color: #96281B !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, .35);
}

/* ============================================================
   CARDS
   ============================================================ */
.card-oferta {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease;
    height: 100%;
}

.card-oferta:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* Price */
.price,
.text-price {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
}

/* ============================================================
   HERO
   ============================================================ */
.hero-section {
    min-height: 88vh;
    background: linear-gradient(135deg, #0f0c1d 0%, #1a1a2e 55%, #2c0e0e 100%);
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(192, 57, 43, .2) 0%, transparent 60%);
    pointer-events: none;
}

.hero-skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    opacity: .25;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.divider-line {
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin: .75rem 0 1.5rem;
}

/* ============================================================
   STATS SECTION
   ============================================================ */
.stats-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a2636 100%);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.stat-number {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stat-label {
    color: rgba(255, 255, 255, .65);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: .4rem;
}

/* ============================================================
   ANIMATIONS – FADE IN ON SCROLL
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(28px);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .65s ease-out, transform .65s ease-out;
}

.fade-in.visible:nth-child(2) {
    transition-delay: .1s;
}

.fade-in.visible:nth-child(3) {
    transition-delay: .2s;
}

.fade-in.visible:nth-child(4) {
    transition-delay: .3s;
}

/* Float animation for hero elements */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.anim-float {
    animation: float 4s ease-in-out infinite;
}

/* Pulse ring around accessibility button */
@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(192, 57, 43, .55);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(192, 57, 43, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(192, 57, 43, 0);
    }
}

.pulse-ring {
    animation: pulseRing 2.5s infinite;
}

/* Glow effect */
@keyframes glowPulse {

    0%,
    100% {
        text-shadow: 0 0 0 transparent;
    }

    50% {
        text-shadow: 0 0 20px rgba(192, 57, 43, .5);
    }
}

/* Shimmer skeleton */
.skeleton {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
    border-radius: var(--radius-sm);
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* ============================================================
   ACCESSIBILITY PANEL
   ============================================================ */
#accessibility-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
    /* ponad footer, pod offcanvasem (1045) - Bootstrap offcanvas jest 1045 */
}

/* ============================================================
   OFERTY – HERO BANNER
   ============================================================ */
.oferty-hero {
    background: linear-gradient(135deg, #0f0c1d 0%, #1e1433 40%, #2c0e0e 100%);
    padding: 72px 0 56px;
    position: relative;
    overflow: hidden;
}

.oferty-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 50%, rgba(192, 57, 43, .22) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 80%, rgba(44, 62, 80, .35) 0%, transparent 50%);
    pointer-events: none;
}

.oferty-hero .container {
    position: relative;
    z-index: 1;
}

.oferty-hero h1 {
    color: #fff;
}

.oferty-hero p {
    color: rgba(255, 255, 255, .65);
}

/* Breadcrumb na tle hero */
.oferty-hero .breadcrumb-item a {
    color: rgba(255, 255, 255, .5);
    text-decoration: none;
}

.oferty-hero .breadcrumb-item a:hover {
    color: #fff;
}

.oferty-hero .breadcrumb-item.active {
    color: rgba(255, 255, 255, .8);
}

.oferty-hero .breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, .3);
}

.btn-access {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(192, 57, 43, .4);
    background: var(--primary);
    color: #fff;
    transition: var(--transition);
}

.btn-access:hover {
    transform: scale(1.12);
    background: var(--primary-dark);
}

.access-offcanvas {
    background: var(--card-bg);
    color: var(--dark);
}

.theme-btn {
    border: 2px solid var(--border);
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--dark);
    transition: var(--transition);
    text-align: center;
}

.theme-btn:hover,
.theme-btn.active {
    border-color: var(--primary);
    background: rgba(192, 57, 43, .06);
    color: var(--primary);
}

.access-mode-btn {
    border-radius: var(--radius-sm);
    text-align: left;
}

.access-mode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.badge-cert {
    font-size: .78rem;
    color: rgba(255, 255, 255, .75);
    margin-bottom: .3rem;
}

/* ============================================================
   ACCESSIBILITY MODES
   ============================================================ */

/* Wysoki kontrast */
body.high-contrast {
    background: #000 !important;
    color: #ffff00 !important;
}

body.high-contrast .text-muted,
body.high-contrast .text-secondary,
body.high-contrast .text-dark,
body.high-contrast .text-body,
body.high-contrast p {
    color: #ffff00 !important;
}

body.high-contrast .card,
body.high-contrast .site-header,
body.high-contrast .btn-praga,
body.high-contrast .offcanvas,
body.high-contrast .access-offcanvas {
    background: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

body.high-contrast a {
    color: #00ffff !important;
}

body.high-contrast .card-oferta {
    border: 2px solid #ffff00 !important;
}

/* Daltonizm – czerwono-zielony (deuteranopia) */
body.deuteranopia {
    filter: url('#deuteranopia-filter');
}

/* Daltonizm – niebieski (protanopia) */
body.protanopia {
    filter: url('#protanopia-filter');
}

/* Monochromatyczny */
body.monochromacy {
    filter: grayscale(1) contrast(1.1);
}

/* Wyraźny fokus klawiaturowy */
body.enhanced-focus *:focus {
    outline: 3px solid #0d6efd !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(13, 110, 253, .25) !important;
}

/* Brak animacji */
.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    border-top: 3px solid var(--primary);
}

.footer-link {
    color: rgba(255, 255, 255, .55);
    text-decoration: none;
    font-size: .88rem;
    transition: color .2s;
}

.footer-link:hover {
    color: #fff;
}

.social-icon {
    transition: var(--transition);
}

.social-icon:hover {
    color: var(--primary) !important;
    transform: translateY(-3px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 575px) {
    #accessibility-panel {
        bottom: 16px;
        right: 16px;
    }

    .btn-access {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* ============================================================
   WHY-US ICON CARDS
   ============================================================ */
.icon-card {
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: var(--transition);
    height: 100%;
    text-align: center;
}

.icon-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.icon-card .icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(192, 57, 43, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    color: var(--primary);
    transition: var(--transition);
}

.icon-card:hover .icon-wrap {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   SEARCH CARD
   ============================================================ */
.search-card {
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    color: #212529;
}