body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #0e1a25;
    background-image: url('/img/pipes/login.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
        'Segoe UI Symbol';
    display: flex;
    align-items: center;
    justify-content: center;
}


.signature-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.signature-svg {
    width: 250px;
    height: auto;
}

.signature-svg text {
    font-family: 'Dancing Script', cursive;
    font-size: 50px;
    fill: none;
    stroke: white;
    stroke-width: 1.2px;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.signature-svg text.animate {
    animation: signature-draw 4s ease forwards;
}

@keyframes signature-draw {
    to {
        stroke-dashoffset: 0;
    }
}


.wind-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('/img/pipes/wind-texture.png');
    background-size: 1340px auto;
    background-repeat: repeat;
    opacity: 0.08;
    animation: moveWind 30s linear infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes moveWind {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: -500px 0;
    }
}



.auth-form {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 20px;
    padding: 40px 30px;
    width: min(100vw - 40px, 380px);
    margin: 60px auto;
    box-shadow: 0 0 60px rgba(255, 0, 0, 0.2), 0 0 10px rgba(255, 0, 0, 0.3);
    color: #fff;
    position: relative;
    overflow: hidden;
    animation: film-light 8s ease-in-out infinite;
    z-index: 2;
    animation: flicker 1.5s infinite;
   
}

/* Efekt filmowego ziarna */
.auth-form::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('https://www.transparenttextures.com/patterns/asfalt-dark.png');
    opacity: 0.07;
    pointer-events: none;
    z-index: 3;
}

.auth-form::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://i.imgur.com/Jg4W3RZ.png');
    background-repeat: repeat;
    background-size: cover;
    opacity: 0.12;
    animation: foggyFlow 30s linear infinite;
    pointer-events: none;
    z-index: 1;
    filter: blur(12px);
}


.film-reel {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 2px,
      transparent 2px,
      transparent 4px
    );
    z-index: 0;
    animation: reelScroll 10s linear infinite;
    pointer-events: none;
}


@keyframes reelScroll {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 100px 0;
  }
}


@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
  }
  20%, 22%, 24%, 55% {
    opacity: 0.95;
  }
}

@keyframes foggyFlow {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    25% {
        transform: translate(60px, -40px) scale(1.02);
    }
    50% {
        transform: translate(-40px, 20px) scale(1.03);
    }
    75% {
        transform: translate(30px, -50px) scale(1.01);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

/* Animacja pulsującego światła */
@keyframes film-light {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.15), 0 0 10px rgba(255, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 0, 0, 0.4), 0 0 15px rgba(255, 0, 0, 0.3);
    }
}


.auth-form__form {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form__header {
    display: flex;
    justify-content: space-around;
}

.auth-form__header-item {
    padding: 28px 12px;
    text-decoration: none;
    text-align: center;
    line-height: 1;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1ch;
    transition: background-color 0.25s;
    color: #11001c;
    background-color: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
}

.auth-form__header-item:hover {
    background-color: #8e85c1;
    color: #000;
}

.auth-form__header-item:first-child {
    border-top-left-radius: 22px;
}

.auth-form__header-item:last-child {
    border-top-right-radius: 22px;
}

.auth-form__footer {
    display: flex;
    flex-direction: column;
}

.auth-form__footer-item {
    padding: 20px 12px;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08ch;
    transition: all 0.3s ease;
    color: #ffffffcc;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: block;
}

.auth-form__footer-item:last-child {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.auth-form__footer-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.auth-form__button-container {
    display: flex;
    justify-content: space-around;
}

.auth-form__primary-button {
    height: 48px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    margin-top: 24px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transform: scale(1);
}

.auth-form__primary-button:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #000;
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.auth-form__primary-button:active {
    transform: scale(0.98);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}


.auth-form__button--text {
    padding: 14px 22px;
    border-radius: 9999px;
    border: none;
    color: #11001c;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    transition: background-color 0.2s;
    background: transparent;
    cursor: pointer;
}

.auth-form__button--text:hover {
    background-color: #a7a0cf;
}

.auth-form__label {
    margin-left: 14px;
    font-size: 16px;
    color: #afd5fd;
    font-weight: bold;
    width: 100%;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(5px);
    animation: fadeInUp 0.5s ease forwards;
}

/* Animacja */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.auth-form__text-input-group,
.auth-form__select-group,
.auth-form__textarea-group {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.auth-form__text-input,
.auth-form__select {
    border-radius: 14px;
    height: 42px;
    padding: 8px 16px;
    margin: 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 400;
    font-size: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.auth-form__text-input::placeholder,
.auth-form__select::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.auth-form__text-input:focus,
.auth-form__select:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}


.auth-form__text-input:focus,
.auth-form__select:focus,
.auth-form__textarea:focus {
    box-shadow:
        0px 2px 4px -1px rgba(0, 0, 0, 0.2),
        0px 4px 5px 0px rgba(0, 0, 0, 0.14),
        0px 1px 10px 0px rgba(0, 0, 0, 0.12);
}

.auth-form__checkbox-input-group {
    margin: 0;
}

.auth-form__checkbox-input {
    margin-left: 12px;
    margin-right: 2px;
}

.auth-form__checkbox-input + .auth-form__label {
    margin-left: 0;
}

.auth-form__fieldset {
    border-radius: 8px;
    border: none;
    padding: 52px 16px 16px 16px;
    box-shadow:
        0px 2px 4px -1px rgba(0, 0, 0, 0.2),
        0px 4px 5px 0px rgba(0, 0, 0, 0.14),
        0px 1px 10px 0px rgba(0, 0, 0, 0.12);
    position: relative;
}

.auth-form__legend {
    font-size: 18px;
    font-weight: bold;
    margin: 12px 0 0 0;
    color: #11001c;
    position: absolute;
    top: 0;
    border: none;
}

.auth-form__textarea {
    height: 300px;
    border-radius: 19px;
    padding: 6px 15px;
    margin: 3px 0;
    border: none;
    box-sizing: border-box;
    background-color: #a7a0cf;
    outline: none;
    transition: outline-color 0.5s;
    font-weight: 400;
    color: #11001c;
}

.auth-form__branding {
    text-decoration: none;
    color: #9682de;
    display: flex;
    column-gap: 5px;
    align-items: center;
    font-size: 3rem;
    flex-direction: column;
    margin-bottom: 12px;
}

.auth-form__site-logo {
    color: #ffffffee;
    font-weight: 300;
    font-size: 2rem;
    font-family: 'Poppins', 'Segoe UI', 'Helvetica Neue', 'Raleway', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.15ch;
    line-height: 1.1;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    animation: logoFadeZoom 0.8s ease-out forwards;
    opacity: 0;
    transform: scale(0.9);
    position: relative;
    z-index: 10;
}

@keyframes logoFadeZoom {
    to {
        opacity: 1;
        transform: scale(1);
    }
}


.auth-form__errors {
    list-style-type: none;
    margin: 0;
    padding: 16px 8px;
}

.auth-form__important-infos {
    list-style-type: none;
    margin: 0;
    padding: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form__error,
.auth-form__important-info {
    color: #22183a;
    font-weight: bold;
    font-size: 16px;
}

[x-cloak] {
    display: none !important;
}


/* Kontener na film w prawym górnym rogu */
.video-corner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}

.video-corner video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: grayscale(100%);
    opacity: 0.15;
    background: transparent;
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 768px) {
    .video-corner video {
        opacity: 0.12;
    }
}

@media (max-width: 480px) {
    .video-corner video {
        opacity: 0.1;
    }
}

.signature-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}


/* Flaga Polski w lewym górnym rogu z efektem zawinięcia */
.polish-flag-corner {
    position: absolute;
    top: -25px;
    left: -45px;
    width: 140px;
    height: 170px;
    overflow: visible;
    z-index: 4;
    pointer-events: none;
}

.polish-flag-corner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 170px;
    background-image: url('/img/pipes/flaga.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.95;
    filter: drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.7));
    transform-origin: left center;
    transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
    border-top-left-radius: 8px;
    clip-path: polygon(
        35% 0%,
        100% 2%,
        99% 25%,
        100% 50%,
        98% 75%,
        100% 98%,
        35% 100%
    );
    animation: flagWave 3s ease-in-out infinite;
}

/* Efekt delikatnego zawinięcia - cień i głębia */
.polish-flag-corner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 170px;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 20%,
        rgba(0, 0, 0, 0.15) 40%,
        transparent 70%
    );
    opacity: 0.7;
    transform-origin: left center;
    transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
    border-top-left-radius: 8px;
    clip-path: polygon(
        35% 0%,
        100% 2%,
        99% 25%,
        100% 50%,
        98% 75%,
        100% 98%,
        35% 100%
    );
    pointer-events: none;
    animation: flagWave 3s ease-in-out infinite;
}

/* Dodatkowy element - załamanie flagi (krawędź) */
.polish-flag-corner-edge {
    position: absolute;
    top: -25px;
    left: -45px;
    width: 50px;
    height: 170px;
    z-index: 3;
    pointer-events: none;
}

.polish-flag-corner-edge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 170px;
    background-image: url('/img/pipes/flaga.png');
    background-size: 280%;
    background-position: left center;
    opacity: 0.5;
    filter: brightness(0.4) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
    transform-origin: right center;
    transform: perspective(600px) rotateY(35deg) rotateX(2deg) translateZ(-5px);
    clip-path: polygon(
        0% 0%,
        100% 0%,
        100% 100%,
        0% 100%
    );
    animation: flagEdgeWave 3s ease-in-out infinite;
}

/* Animacja powiewania flagi - delikatne trzepotanie */
@keyframes flagWave {
    0%, 100% {
        transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
        clip-path: polygon(
            35% 0%,
            100% 0%,
            99% 20%,
            100% 40%,
            98% 60%,
            100% 80%,
            99% 100%,
            35% 100%
        );
    }
    16.6% {
        transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
        clip-path: polygon(
            35% 0%,
            99% 0%,
            100% 20%,
            97% 40%,
            100% 60%,
            99% 80%,
            100% 100%,
            35% 100%
        );
    }
    33.3% {
        transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
        clip-path: polygon(
            35% 0%,
            100% 0%,
            98% 20%,
            100% 40%,
            97% 60%,
            100% 80%,
            98% 100%,
            35% 100%
        );
    }
    50% {
        transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
        clip-path: polygon(
            35% 0%,
            99% 0%,
            100% 20%,
            98% 40%,
            100% 60%,
            97% 80%,
            100% 100%,
            35% 100%
        );
    }
    66.6% {
        transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
        clip-path: polygon(
            35% 0%,
            100% 0%,
            97% 20%,
            100% 40%,
            98% 60%,
            100% 80%,
            99% 100%,
            35% 100%
        );
    }
    83.3% {
        transform: perspective(600px) rotateY(-25deg) rotateX(3deg) translateZ(10px);
        clip-path: polygon(
            35% 0%,
            99% 0%,
            100% 20%,
            99% 40%,
            100% 60%,
            98% 80%,
            100% 100%,
            35% 100%
        );
    }
}

/* Animacja powiewania - krawędź (subtelna) */
@keyframes flagEdgeWave {
    0%, 100% {
        transform: perspective(600px) rotateY(35deg) rotateX(2deg) translateZ(-5px);
        filter: brightness(0.4) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
    }
    50% {
        transform: perspective(600px) rotateY(35deg) rotateX(2deg) translateZ(-5px);
        filter: brightness(0.38) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
    }
}

/* Responsywność dla flagi na małych ekranach */
@media (max-width: 480px) {
    .polish-flag-corner {
        width: 100px;
        height: 120px;
        top: -20px;
        left: -35px;
    }
    
    .polish-flag-corner::before,
    .polish-flag-corner::after {
        width: 100px;
        height: 120px;
    }
    
    .polish-flag-corner-edge {
        width: 40px;
        height: 120px;
        top: -20px;
        left: -35px;
    }
    
    .polish-flag-corner-edge::before {
        width: 40px;
        height: 120px;
    }
}