/* ============================================================
   FazeRP - warstwa "modern" (tylko strona glowna)
   Ladowana po ui.css, wiec nadpisuje to, co trzeba.
   Wszystkie efekty maja wylacznik: .limit-anim na <html>
   (slaby sprzet / oszczedzanie danych) oraz prefers-reduced-motion.
   ============================================================ */

:root {
    --glass-bg: rgba(10, 16, 26, 0.82);
    --glass-border: rgba(120, 170, 255, 0.16);
    --glass-border-strong: rgba(120, 170, 255, 0.32);
    --accent-grad: linear-gradient(120deg, #0f87ff, #00d1ff 55%, #00ffae);
    --online: #22e07a;
    --offline: #ff5f6d;
}

/* ---------- 1. Aurora - powolne plamy swiatla w tle ----------
   WAZNE: zadnego filter: blur() ani will-change. Gradient radialny
   z miekkim wygaszeniem wyglada tak samo, a nie tworzy warstwy,
   ktora karta graficzna musi rozmywac w kazdej klatce. */
.aurora {
    position: fixed;
    inset: -20vh -10vw;
    z-index: -900;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

.aurora span {
    position: absolute;
    display: block;
    border-radius: 50%;
    opacity: 0.5;
}

.aurora span:nth-child(1) {
    width: 60vw;
    height: 60vw;
    top: -14vh;
    left: -10vw;
    background: radial-gradient(circle closest-side, rgba(11, 107, 255, 0.5), rgba(11, 107, 255, 0.14) 45%, transparent 72%);
}

.aurora span:nth-child(2) {
    width: 52vw;
    height: 52vw;
    top: 2vh;
    right: -12vw;
    background: radial-gradient(circle closest-side, rgba(0, 209, 255, 0.36), rgba(0, 209, 255, 0.1) 45%, transparent 72%);
}

/* trzecia plama tylko na duzych ekranach - na laptopach nic nie wnosi */
.aurora span:nth-child(3) {
    display: none;
}

@media (min-width: 1400px) {
    .aurora span:nth-child(3) {
        display: block;
        width: 44vw;
        height: 44vw;
        bottom: -16vh;
        left: 26vw;
        background: radial-gradient(circle closest-side, rgba(0, 255, 174, 0.22), transparent 70%);
    }
}

/* ---------- 2. Pasek postepu czytania ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: var(--accent-grad);
    z-index: 2000;
    pointer-events: none;
}

/* ---------- 3. Naglowek przyklejony do gory ---------- */
.header {
    position: sticky;
    top: 0;
    transition: padding .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.header.is-scrolled {
    padding-top: 4px;
    padding-bottom: 4px;
    background: rgba(3, 7, 15, 0.94);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.header.is-scrolled .logo .after img {
    height: 42px;
    transition: height .25s ease;
}

.header .logo .after img {
    transition: height .25s ease;
}

/* ---------- 4. Status serwera na zywo ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.86rem;
    font-weight: 500;
    color: #d7e6f7;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .25s ease, transform .25s ease;
}

.status-pill:hover {
    border-color: var(--glass-border-strong);
    transform: translateY(-1px);
}

.status-dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6c7a8a;
    flex: 0 0 auto;
}

.status-pill[data-state="online"] .status-dot {
    background: var(--online);
}

/* Statyczna poswiata: status pozostaje czytelny bez stalej animacji. */
.status-pill[data-state="online"] .status-dot {
    box-shadow: 0 0 0 3px rgba(34, 224, 122, 0.14);
}

/* Stare efekty tekstu wymuszaly stale przemalowywanie text-shadow/transform. */
.text,
.key {
    animation: none;
}

.status-pill[data-state="offline"] .status-dot {
    background: var(--offline);
}

.status-pill b {
    color: #fff;
    font-weight: 700;
}

/* wariant w naglowku - ui.css nadaje wszystkim <a> w .header sztywne 250x60 */
.header .status-pill {
    width: auto;
    height: auto;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
}

/* wariant w sekcji hero */
.hero-status {
    margin-bottom: 6px;
}

/* ---------- 5. Kafelki statystyk w hero ---------- */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: min(760px, 100%);
    margin-top: 30px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 14px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-strong);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
}

.stat-value {
    font-size: clamp(24px, 3.4vw, 34px);
    font-weight: 800;
    line-height: 1.1;
    background: var(--accent-grad);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93a4b6;
}

/* kafelek z adresem + kopiowaniem */
.stat-card.copy-card {
    cursor: pointer;
    border-style: dashed;
}

.stat-card.copy-card .stat-value {
    font-size: clamp(17px, 2.2vw, 22px);
    letter-spacing: 0.02em;
}

.stat-card.copy-card .stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-card.copy-card svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.stat-card.copy-card.copied {
    border-style: solid;
    border-color: var(--online);
}

/* ---------- 6. Toast ---------- */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2500;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border-radius: 12px;
    background: rgba(9, 16, 28, 0.96);
    border: 1px solid var(--glass-border-strong);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    color: #eaf3ff;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .28s ease, transform .28s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast svg {
    width: 16px;
    height: 16px;
    fill: var(--online);
    flex: 0 0 auto;
}

/* ---------- 7. Przycisk "do gory" ---------- */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--glass-border-strong);
    border-radius: 50%;
    background: var(--glass-bg);
    color: #cfe2f7;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background-color .3s ease;
    z-index: 1500;
}

.to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover {
    background: rgba(37, 92, 184, 0.4);
    color: #fff;
}

.to-top svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transform: rotate(180deg);
}

/* ---------- 8. Szkielko na kartach + drobne poprawki ---------- */
.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: background-color .3s ease, border-color .3s ease, transform .3s ease;
}

.faq-item:hover {
    border-color: var(--glass-border-strong);
}

.faq-item.open {
    border-color: var(--glass-border-strong);
    background: rgba(14, 24, 40, 0.78);
}

.faq-help {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.about-box-front,
.about-box-back {
    border: 1px solid var(--glass-border);
    background-color: rgba(8, 14, 24, 0.7);
}

/* subtelny polysk na glownym CTA */
.connect-button,
.polacz-button {
    position: relative;
    overflow: hidden;
}

.connect-button::after,
.polacz-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-18deg);
    transition: left .6s ease;
}

.connect-button:hover::after,
.polacz-button:hover::after {
    left: 120%;
}

/* link "przejdz do tresci" dla klawiatury i czytnikow ekranu */
.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 3000;
    padding: 10px 16px;
    border-radius: 0 0 10px 10px;
    background: #0f87ff;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: top .2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ---------- 9. Mobile ---------- */
@media (max-width: 820px) {
    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        margin-top: 22px;
    }

    .stat-card {
        min-width: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 13px 10px;
        text-align: center;
    }

    .stat-card .stat-value,
    .stat-card .stat-label {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .stat-card.copy-card {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        padding-inline: 16px;
    }

    /* na telefonie status jest juz w kafelkach hero - nie dublujemy go w naglowku */
    .header .status-pill {
        display: none;
    }

    .to-top {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 460px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .stat-card.copy-card {
        grid-column: 1;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 14px;
        text-align: left;
    }

    .stat-card .stat-value {
        font-size: 1.15rem;
    }
}

/* ---------- 10. Wylaczniki animacji ---------- */
.limit-anim .aurora span {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .aurora span {
        animation: none;
    }

    .scroll-progress,
    .header,
    .stat-card,
    .toast,
    .to-top {
        transition: none;
    }

    .connect-button::after,
    .polacz-button::after {
        display: none;
    }
}
