/* ============================================================
   FazeRP - szybka, wspolna warstwa dla pozostalych podstron.
   Tylko statyczne gradienty i lekkie przejscia interakcji.
   ============================================================ */

.modern-page {
    --page-surface: rgba(8, 15, 27, 0.95);
    --page-surface-soft: rgba(13, 23, 39, 0.78);
    --page-border: rgba(120, 172, 244, 0.15);
    --page-border-strong: rgba(83, 177, 255, 0.34);
    --page-text: #edf5ff;
    --page-muted: #91a4ba;
    min-height: 100vh;
    color: var(--page-text);
    background:
        radial-gradient(circle at 8% 3%, rgba(24, 120, 255, 0.19), transparent 31rem),
        radial-gradient(circle at 91% 18%, rgba(24, 211, 232, 0.09), transparent 28rem),
        linear-gradient(180deg, #050913, #060b15 48%, #04070d);
}

.modern-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .22;
    background-image:
        linear-gradient(rgba(125, 175, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 175, 255, .045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

/* ---------- Naglowek ---------- */
.modern-page .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 72px;
    padding: 8px clamp(16px, 3vw, 38px);
    gap: 20px;
    background: rgba(5, 9, 18, .97);
    border-bottom: 1px solid var(--page-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}

.modern-page .header .logo { flex: 0 0 auto; }
.modern-page .header .logo h1 { left: auto; margin: 0; }
.modern-page .header .logo .after { width: auto; height: auto; padding: 0; }
.modern-page .header .logo .after img {
    display: block;
    width: auto;
    height: 52px;
    object-fit: contain;
}

.modern-page .header nav { flex: 1 1 auto; min-width: 0; }
.modern-page .header .index-ul {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.modern-page .header .index-ul li,
.modern-page .header .index-ul li a {
    margin: 0;
    transform: none;
}

.modern-page .header .index-ul li a {
    display: inline-flex;
    width: auto;
    height: auto;
    padding: 9px 11px;
    color: #8fa2b8;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
}

.modern-page .header .index-ul li a:hover,
.modern-page .header .index-ul li a.is-active {
    color: #f4f8ff;
    background: rgba(53, 168, 255, .12);
}

.modern-page .header .login-link {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 40px;
    margin: 0;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: .82rem;
}

/* ---------- Dokumenty i narzedzia ---------- */
.modern-page .dokumenty-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 78px;
}

.modern-page .spis-tresci-container {
    position: sticky;
    top: 94px;
    left: auto;
    flex: 0 0 230px;
    display: block;
    width: 230px;
    max-height: calc(100vh - 118px);
    margin: 0;
    padding: 16px 12px;
    overflow-y: auto;
    opacity: 1;
    transform: none;
    animation: none;
    background: var(--page-surface);
    border: 1px solid var(--page-border);
    border-radius: 16px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

.modern-page .spis-tresci-container h6 {
    margin: 0 7px 10px;
    color: #e9f2ff;
    font-size: .75rem;
    letter-spacing: .1em;
    text-align: left;
    opacity: 1;
    animation: none;
}

.modern-page .spis-tresci-container p {
    margin: 2px 0;
    opacity: 1;
    transform: none;
    animation: none;
    font-size: .77rem;
}

.modern-page .spis-tresci-container a {
    display: block;
    padding: 8px 9px;
    color: #7f93aa;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    line-height: 1.4;
    text-decoration: none;
}

.modern-page .spis-tresci-container a:hover {
    color: #e7f3ff;
    background: rgba(53, 168, 255, .09);
    border-left-color: #35a8ff;
}

.modern-page .dokumenty-box {
    position: relative;
    display: block;
    width: min(920px, 100%);
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 42px clamp(20px, 4vw, 48px) 52px;
    overflow: hidden;
    background: var(--page-surface);
    border: 1px solid var(--page-border);
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .3);
}

.modern-page .dokumenty-box::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 180px;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 85% 0, rgba(46, 202, 242, .14), transparent 17rem),
        linear-gradient(180deg, rgba(26, 47, 76, .42), transparent);
}

.modern-page .dokumenty-box > * { position: relative; z-index: 1; }

.modern-page .dokumenty-box > h1 {
    width: 100%;
    margin: 0 0 28px;
    color: #f5f9ff;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -.04em;
    text-align: left;
}

.modern-page .dokumenty-box > h2 {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 34px 0 14px;
    padding: 0 0 13px 17px;
    color: #eaf3ff;
    border-bottom: 1px solid rgba(126, 173, 233, .13);
    font-size: clamp(1.17rem, 3vw, 1.5rem);
    line-height: 1.35;
    text-align: left;
}

.modern-page .dokumenty-box > h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 16px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(#2b91ff, #38dbf3);
}

.modern-page .dokumenty-box > p,
.modern-page .dokumenty-box > .akapit {
    width: 100%;
    margin: 7px 0;
    padding: 11px 14px;
    color: #bccadb;
    background: rgba(255, 255, 255, .018);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .87rem;
    line-height: 1.7;
    text-align: left;
}

.modern-page .dokumenty-box h3 {
    width: 100%;
    margin: 26px 0 12px;
    padding: 15px 17px;
    color: #cbd9e8;
    background: rgba(255, 190, 72, .06);
    border: 1px solid rgba(255, 190, 72, .14);
    border-radius: 11px;
    font-size: .84rem;
    line-height: 1.7;
    text-align: left;
}

.modern-page .dokumenty-box h4,
.modern-page .dokumenty-box h5,
.modern-page .dokumenty-box li {
    color: #b7c6d7;
    font-size: .86rem;
    line-height: 1.65;
}

.modern-page .dokumenty-box a { color: #63c8ff; }

.modern-page .dokumenty-box button.exit-button {
    position: absolute;
    top: 20px;
    right: 22px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #a9bbcf;
    background: rgba(5, 11, 21, .75);
    border: 1px solid var(--page-border);
    border-radius: 10px;
}

.modern-page .dokumenty-box button.exit-button:hover {
    color: #fff;
    background: rgba(23, 40, 64, .95);
    border-color: var(--page-border-strong);
}

/* ---------- Tabele, kalkulatory, wyszukiwarki ---------- */
.modern-page .table-container,
.modern-page .table-wrapper {
    width: 100%;
    margin: 18px 0;
    overflow-x: auto;
    border: 1px solid var(--page-border);
    border-radius: 13px;
}

.modern-page table {
    width: 100%;
    min-width: 650px;
    margin: 0;
    border-collapse: collapse;
    background: rgba(4, 9, 17, .72);
}

.modern-page th,
.modern-page td {
    padding: 12px 14px;
    color: #b9c9db;
    border: 1px solid rgba(123, 166, 220, .11);
    font-size: .8rem;
    text-align: left;
}

.modern-page th {
    color: #e8f2ff;
    background: rgba(53, 168, 255, .09);
}

.modern-page input,
.modern-page select,
.modern-page textarea,
.modern-page .taryfikator-search {
    color: #edf5ff;
    background: rgba(4, 9, 17, .8);
    border: 1px solid rgba(125, 171, 231, .16);
    border-radius: 10px;
}

.modern-page input:focus,
.modern-page select:focus,
.modern-page textarea:focus {
    outline: none;
    border-color: #35a8ff;
    box-shadow: 0 0 0 3px rgba(53, 168, 255, .12);
}

.modern-page .calc-items-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}

.modern-page .calc-item,
.modern-page .admin-info {
    width: 100%;
    padding: 18px;
    background: var(--page-surface-soft);
    border: 1px solid var(--page-border);
    border-radius: 14px;
}

.modern-page .cta-button,
.modern-page .ghost-button,
.modern-page .dokumenty-box button:not(.exit-button) {
    border-radius: 10px;
    transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

.modern-page .dokumenty-box .shop-cta {
    color: #07111f;
    background: #f7fbff;
    border: 1px solid #fff;
    box-shadow: 0 10px 24px rgba(149, 211, 255, .18);
}

.modern-page .dokumenty-box .shop-cta:hover {
    color: #02060b;
    background: #fff;
    border-color: #bde9ff;
    box-shadow: 0 13px 30px rgba(113, 204, 255, .28);
}

.modern-page .dokumenty-box .shop-cta .material-symbols-outlined {
    color: #0873bb;
}

.modern-page .footer .socials i {
    font-size: 17px;
}

.modern-page .cta-button:hover,
.modern-page .ghost-button:hover,
.modern-page .dokumenty-box button:not(.exit-button):hover {
    transform: translateY(-1px);
}

/* ---------- Podania / kafelki ---------- */
.modern-page .liczba-podan {
    display: inline-flex;
    margin: 0 0 18px;
    padding: 8px 12px;
    color: #72d8ff;
    background: rgba(53, 168, 255, .09);
    border: 1px solid rgba(53, 168, 255, .18);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.modern-page .podania-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}

.modern-page .podanie-kafelek {
    width: 100%;
    margin: 0;
    padding: 18px;
    background: var(--page-surface-soft);
    border: 1px solid var(--page-border);
    border-radius: 15px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
}

.modern-page .podanie-avatar {
    border: 2px solid rgba(74, 185, 255, .36);
    border-radius: 12px;
}

/* ---------- Stopka ---------- */
.modern-page .footer {
    margin: 0;
    padding: 30px 20px;
    background: rgba(3, 7, 13, .95);
    border-top: 1px solid var(--page-border);
}

.modern-page .footer p {
    width: 100%;
    margin: 16px 0 0;
    color: #667b92;
    font-size: .76rem;
    text-align: center;
}

@media (max-width: 980px) {
    .modern-page .header {
        position: relative;
        flex-wrap: wrap;
        justify-content: center;
    }

    .modern-page .header nav {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
    }

    .modern-page .header .index-ul {
        flex-flow: row nowrap;
        justify-content: flex-start;
        width: max-content;
        min-width: 100%;
        padding-bottom: 6px;
    }

    .modern-page .dokumenty-container {
        flex-direction: column;
        width: min(920px, calc(100% - 24px));
        padding-top: 22px;
    }

    .modern-page .spis-tresci-container {
        position: relative;
        top: auto;
        flex: auto;
        width: 100%;
        max-height: none;
    }
}

@media (max-width: 700px) {
    .modern-page .dokumenty-box {
        padding: 64px 14px 36px;
        border-radius: 16px;
    }

    .modern-page .dokumenty-box > h1 { font-size: 2rem; }
    .modern-page .dokumenty-box > p,
    .modern-page .dokumenty-box > .akapit { padding: 10px 11px; font-size: .81rem; }
    .modern-page .calc-items-container,
    .modern-page .podania-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .modern-page *,
    .modern-page *::before,
    .modern-page *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
