:root {
    --gold: #d4a72c;
    --gold-strong: #f0c34a;
    --gold-light: #ffe08a;
    --gold-dark: #8a6512;

    --panel: rgba(18, 19, 22, 0.92);
    --panel-light: rgba(29, 31, 36, 0.94);

    --text: #f5f5f5;
    --border: rgba(212, 167, 44, 0.28);

    --header-height: 160px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
}

body {
    min-height: 100vh;

    color: var(--text);
    background: #070809;

    overflow-x: hidden;
}


/* ============================================================
   TLO
   ============================================================ */

.background-image {
    position: fixed;
    inset: 0;

    z-index: 0;

    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;

    filter:
        saturate(0.82)
        brightness(1.20)
        contrast(0.88);

    transform: scale(1.02);

    transition:
        transform 0.25s ease-out;
}

.background-image::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(12, 13, 16, 0.18) 0%,
            rgba(12, 13, 16, 0.10) 32%,
            rgba(12, 13, 16, 0.08) 58%,
            rgba(12, 13, 16, 0.16) 100%
        ),
        radial-gradient(
            circle at 50% 48%,
            transparent 25%,
            rgba(0, 0, 0, 0.03) 60%,
            rgba(0, 0, 0, 0.10) 100%
        );
}

/* ============================================================
   ENERGIA
   ============================================================ */

.energy-background {
    position: fixed;
    inset: 0;

    z-index: 1;

    overflow: hidden;

    pointer-events: none;
}

.energy-line {
    position: absolute;

    width: 58vw;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(212, 167, 44, 0.08),
            rgba(255, 224, 138, 0.76),
            rgba(212, 167, 44, 0.08),
            transparent
        );

    box-shadow:
        0 0 9px rgba(212, 167, 44, 0.22);

    opacity: 0.58;
}

.energy-line::after {
    content: "";

    position: absolute;

    top: -4px;
    left: 0;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--gold-light);

    box-shadow:
        0 0 8px var(--gold-light),
        0 0 20px var(--gold);

    animation:
        energy-flow
        5.2s
        linear
        infinite;
}

.energy-line.line-1 {
    top: 31%;
    left: -10%;

    transform: rotate(-7deg);
}

.energy-line.line-2 {
    top: 66%;
    right: -12%;

    transform: rotate(7deg);
}

.energy-line.line-2::after {
    animation-delay: -2.6s;
}

.energy-line.line-3 {
    top: 84%;
    left: 14%;

    width: 72vw;

    opacity: 0.34;
}

.energy-line.line-3::after {
    animation-delay: -1.2s;
}

@keyframes energy-flow {
    from {
        left: 0%;
    }

    to {
        left: 100%;
    }
}


/* ============================================================
   HEADER
   ============================================================ */

.top-header {
    position: relative;

    z-index: 10;

    height: var(--header-height);

    display: flex;

    background:
        linear-gradient(
            90deg,
            rgba(9, 10, 12, 0.98) 0%,
            rgba(22, 24, 28, 0.96) 48%,
            rgba(9, 10, 12, 0.98) 100%
        );

    border-bottom:
        1px solid rgba(212, 167, 44, 0.42);

    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.38);
}


/* ============================================================
   LOGO
   ============================================================ */

.header-logo-section {
    width: 320px;
    min-width: 320px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px 22px;

    background:
        linear-gradient(
            145deg,
            rgba(15, 16, 19, 0.98),
            rgba(7, 8, 10, 0.98)
        );

    border-right:
        1px solid rgba(212, 167, 44, 0.26);
}

.navbar-logo {
    display: block;

    width: 235px;
    max-height: 148px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 0 18px rgba(212, 167, 44, 0.14)
        );
}


/* ============================================================
   HEADER PRAWA STRONA
   ============================================================ */

.header-banner {
    flex: 1;

    display: flex;
    align-items: center;

    padding:
        20px
        clamp(24px, 4vw, 80px);

    gap:
        clamp(28px, 4vw, 72px);
}

.header-title-section {
    min-width: 360px;
    max-width: 620px;
}

.scada-main-title {
    font-size:
        clamp(34px, 3.2vw, 58px);

    line-height: 1;

    font-weight: 900;

    letter-spacing: 2.8px;

    background:
        linear-gradient(
            180deg,
            #fff0b3 0%,
            #f0c34a 34%,
            #d4a72c 68%,
            #a77918 100%
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    background-clip: text;
    color: transparent;

    filter:
        drop-shadow(
            0 0 10px rgba(212, 167, 44, 0.12)
        );
}

.scada-subtitle {
    margin-top: 13px;

    max-width: 580px;

    color: #ece6d2;

    font-size: 16px;
    line-height: 1.45;

    font-weight: 500;
}

.header-divider {
    width: 1px;
    height: 82px;

    background:
        linear-gradient(
            transparent,
            var(--gold),
            transparent
        );
}


/* ============================================================
   KONTAKT
   ============================================================ */

.header-contact-section {
    display: flex;
    flex-direction: column;

    gap: 11px;
}

.contact-box {
    min-width: 310px;

    display: flex;
    align-items: center;

    gap: 14px;

    padding: 13px 18px;

    border:
        1px solid rgba(212, 167, 44, 0.34);

    border-radius: 10px;

    background:
        linear-gradient(
            90deg,
            rgba(212, 167, 44, 0.10),
            rgba(255, 255, 255, 0.015)
        );

    color: #f5f2ea;

    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.contact-box:hover {
    background:
        rgba(212, 167, 44, 0.14);

    border-color: var(--gold);

    transform:
        translateX(2px);
}

.contact-box svg {
    flex: 0 0 auto;

    color: var(--gold-light);
}


/* ============================================================
   MAIN
   ============================================================ */

main {
    position: relative;

    z-index: 2;

    min-height:
        calc(100vh - var(--header-height));

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        64px
        20px;
}


/* ============================================================
   LOGIN CARD
   ============================================================ */

.login-card {
    position: relative;

    z-index: 3;

    width: 100%;
    max-width: 520px;

    padding:
        42px
        42px
        36px;

    background:
        linear-gradient(
            145deg,
            rgba(29, 31, 36, 0.91),
            rgba(13, 14, 17, 0.94)
        );

    backdrop-filter:
        blur(9px);

    -webkit-backdrop-filter:
        blur(9px);

    border:
        1px solid var(--border);

    border-radius: 16px;

    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.58),
        0 0 55px rgba(212, 167, 44, 0.045);

    overflow: hidden;
}

.login-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold),
            var(--gold-light),
            var(--gold),
            transparent
        );
}

.login-title-small {
    margin-bottom: 8px;

    color: var(--gold);

    text-transform: uppercase;

    letter-spacing: 3px;

    font-size: 11px;
    font-weight: 800;
}

.login-card h1 {
    margin:
        0
        0
        28px;

    color: #fff;

    font-size: 34px;
    font-weight: 700;
}


/* ============================================================
   FORM
   ============================================================ */

.login-form {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.login-form p {
    margin: 0;

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.login-form label {
    color: #ddd7c7;

    font-size: 13px;
    font-weight: 600;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"] {
    width: 100%;
    height: 52px;

    padding:
        0
        15px;

    background:
        rgba(10, 11, 14, 0.94);

    color: #fff;

    border:
        1px solid #383c43;

    border-radius: 8px;

    font-size: 15px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.login-form input:focus {
    background: #111318;

    border-color: var(--gold);

    box-shadow:
        0 0 0 3px rgba(212, 167, 44, 0.10);
}


/* ============================================================
   BUTTON
   ============================================================ */

.login-button {
    position: relative;

    height: 54px;

    margin-top: 6px;

    border: none;
    border-radius: 8px;

    cursor: pointer;

    overflow: hidden;

    color: #121212;

    font-size: 15px;
    font-weight: 800;

    letter-spacing: 0.35px;

    background:
        linear-gradient(
            135deg,
            #b88616,
            #e0b83d,
            #f0cf67
        );

    box-shadow:
        0 10px 28px rgba(212, 167, 44, 0.18);

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.login-button::after {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;

    left: -50%;

    width: 35%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.55),
            transparent
        );

    transform:
        skewX(-20deg);

    animation:
        button-energy
        4s
        ease-in-out
        infinite;
}

.login-button:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 12px 32px rgba(212, 167, 44, 0.28);
}

.login-button:active {
    transform:
        translateY(1px);
}

@keyframes button-energy {
    0%,
    65% {
        left: -50%;
    }

    100% {
        left: 130%;
    }
}


/* ============================================================
   ERRORS
   ============================================================ */

.login-errors {
    padding:
        12px
        15px;

    border:
        1px solid rgba(255, 92, 92, 0.35);

    border-radius: 7px;

    background:
        rgba(150, 20, 20, 0.16);

    color:
        #ffc7c7;

    font-size: 13px;
}

.login-errors ul {
    margin: 0;

    padding-left: 18px;
}


/* ============================================================
   STATUS
   ============================================================ */

.system-status {
    margin-top: 26px;

    padding-top: 20px;

    display: flex;
    align-items: center;

    gap: 9px;

    border-top:
        1px solid rgba(255, 255, 255, 0.06);

    color: #8d9096;

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--gold);

    box-shadow:
        0 0 8px var(--gold);

    animation:
        status-pulse
        2s
        ease-in-out
        infinite;
}

@keyframes status-pulse {
    0%,
    100% {
        opacity: 0.45;
    }

    50% {
        opacity: 1;
    }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 920px) {

    :root {
        --header-height: auto;
    }

    .top-header {
        height: auto;

        flex-direction: column;
    }

    .header-logo-section {
        width: 100%;
        min-width: 0;

        padding: 16px;
    }

    .navbar-logo {
        width: 195px;
        max-height: 125px;
    }

    .header-banner {
        width: 100%;

        flex-direction: column;

        text-align: center;

        gap: 20px;

        padding:
            24px
            22px;
    }

    .header-title-section {
        min-width: 0;
    }

    .header-divider {
        width: 75%;
        height: 1px;
    }

    .contact-box {
        min-width: 0;
        width: 100%;
    }

    main {
        min-height: auto;

        padding:
            44px
            18px;
    }

    .login-card {
        padding:
            32px
            25px;
    }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .energy-line::after,
    .login-button::after,
    .status-dot {
        animation: none;
    }
}

.login-footer {
    position: relative;
    z-index: 5;

    width: 100%;
    padding: 14px 20px 20px;

    text-align: center;

    color: rgba(255, 255, 255, 0.45);

    font-size: 11px;
    letter-spacing: 0.6px;
}

.login-footer::first-letter {
    color: var(--gold);
}
/* ============================================================
   LOGIN V2 - uproszczony header i rozwijany kontakt
   ============================================================ */

.login-top-header .header-banner {
    justify-content: center;
}

.login-top-header .header-title-section {
    width: 100%;
    max-width: 760px;
    min-width: 0;
    text-align: center;
}

.login-top-header .scada-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.login-card {
    max-width: 500px;
    padding: 40px 40px 34px;
    border-color: rgba(212, 167, 44, 0.34);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.62),
        0 0 70px rgba(212, 167, 44, 0.055);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"] {
    height: 54px;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(7, 8, 11, 0.88);
}

.login-form input:hover {
    border-color: rgba(212, 167, 44, 0.48);
}

.login-button {
    height: 56px;
    border-radius: 10px;
}

.login-contact-panel {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.login-contact-panel summary {
    list-style: none;
    min-height: 46px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #c7c9ce;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.login-contact-panel summary::-webkit-details-marker {
    display: none;
}

.login-contact-panel summary:hover {
    color: var(--gold-light);
}

.contact-summary-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.contact-summary-icon {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 167, 44, 0.35);
    border-radius: 50%;
    color: var(--gold-light);
    background: rgba(212, 167, 44, 0.08);
    font-size: 13px;
}

.contact-summary-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.login-contact-panel[open] .contact-summary-arrow {
    transform: rotate(225deg) translate(-2px, -2px);
}

.login-contact-content {
    margin-top: 4px;
    padding: 16px 16px 17px 47px;
    border-radius: 10px;
    border: 1px solid rgba(212, 167, 44, 0.18);
    background: rgba(212, 167, 44, 0.055);
}

.login-contact-label {
    margin-bottom: 5px;
    color: #8f939a;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.login-contact-email {
    color: #f3d77c;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.15px;
    user-select: text;
    cursor: text;
}

.login-card-locked h1 {
    margin-bottom: 20px;
    color: #fff;
    font-size: 30px;
}

.lockout-message {
    padding: 16px 17px;
    border: 1px solid rgba(255, 92, 92, 0.30);
    border-left: 4px solid #d85b5b;
    border-radius: 9px;
    background: rgba(130, 24, 24, 0.13);
    color: #f5eaea;
    font-size: 14px;
    line-height: 1.65;
}

.lockout-info {
    margin: 14px 0 22px;
    color: #aaaeb5;
    font-size: 13px;
}

.login-button-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 920px) {
    .login-top-header .header-banner {
        padding: 22px 18px;
    }

    .login-top-header .header-title-section {
        text-align: center;
    }

    .login-card {
        max-width: 520px;
        padding: 32px 24px 28px;
    }

    .login-contact-content {
        padding-left: 16px;
    }
}


/* ============================================================
   KONTAKT - IKONA
   ============================================================ */

.contact-summary-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================================================
   BLOKADA LOGOWANIA
   ============================================================ */

.login-lockout-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 14px 15px;

    border: 1px solid rgba(240, 195, 74, 0.34);
    border-left: 4px solid var(--gold-strong);
    border-radius: 9px;

    background:
        linear-gradient(
            90deg,
            rgba(212, 167, 44, 0.13),
            rgba(212, 167, 44, 0.045)
        );

    color: #f4ead0;

    font-size: 13px;
    line-height: 1.55;
}

.login-lockout-icon {
    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(212, 167, 44, 0.12);
    color: var(--gold-light);
}

.login-lockout-icon svg {
    width: 16px;
    height: 16px;

    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
