* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Desktop - Smooth scrolling */
@media (min-width: 1024px) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a3d0c 0%, #165e1a 20%, #1e8826 40%, #c62828 70%, #8b1818 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Śnieżynki CSS - tylko 3 dla wydajności */
body::before {
    content: '❄️  ❄️  ❄️';
    position: fixed;
    top: -50px;
    left: 0;
    width: 100%;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    animation: snowfall 20s linear infinite;
    pointer-events: none;
    z-index: 1;
    letter-spacing: 120px;
    will-change: transform;
}

@keyframes snowfall {
    0% {
        transform: translate3d(0, -50px, 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 100vh, 0);
        opacity: 0;
    }
}

.container {
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                0 0 30px rgba(255, 215, 0, 0.2),
                inset 0 0 30px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Świąteczne świecenie ramki - UPROSZCZONE */
.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0000, #ffd700, #00ff00);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.15;
    filter: blur(6px);
}

h1 {
    color: #ffffff;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6),
                 0 0 25px rgba(255, 0, 0, 0.3),
                 0 2px 10px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    letter-spacing: 1px;
}

h2 {
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

/* Readonly inputs (jak personalLink) */
input[readonly],
input:read-only {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    cursor: text;
}

/* Disabled inputs */
input:disabled,
select:disabled,
textarea:disabled {
    color: rgba(255, 255, 255, 0.6) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.6) !important;
    opacity: 0.7;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Wymuszenie białego tekstu dla autofill w Chrome/Safari/Edge */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.1) inset !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Wymuszenie białego tekstu dla Firefox */
input,
select,
textarea {
    color-scheme: dark;
}

select {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"%3E%3Cpath fill="%23ffffff" d="M0 0l6 8 6-8z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

select option {
    background: #1a1a1a !important;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    padding: 8px;
}

optgroup {
    font-weight: bold;
    font-style: normal;
    color: #ffffff !important;
    background: #0d0d0d !important;
    background-color: #0d0d0d !important;
}

textarea {
    resize: vertical;
    font-family: inherit;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

small {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 14px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #ffffff !important;
}

.btn-primary {
    background: linear-gradient(135deg, #0a8f08 0%, #c62828 50%, #ffd700 100%);
    color: #ffffff !important;
    width: 100%;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d9e0a 0%, #d32f2f 50%, #ffed4e 100%);
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #0a8f08 0%, #0d9e0a 100%);
    color: #ffffff !important;
    width: 100%;
    box-shadow: 0 4px 15px rgba(10, 143, 8, 0.4);
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0d9e0a 0%, #11b30d 100%);
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 6px 20px rgba(10, 143, 8, 0.6);
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background: rgba(40, 167, 69, 0.2);
    color: #ffffff;
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.message.error {
    background: rgba(220, 53, 69, 0.2);
    color: #ffffff;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.message.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.success-box {
    margin-top: 30px;
    padding: 20px;
    background: rgba(40, 167, 69, 0.15);
    border-radius: 12px;
    border: 2px solid rgba(40, 167, 69, 0.3);
    backdrop-filter: blur(10px);
    animation: successBoxAppear 0.5s ease-out;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

@keyframes successBoxAppear {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.success-box h3 {
    color: #ffffff;
    margin-bottom: 15px;
}

.success-box p {
    color: rgba(255, 255, 255, 0.9);
}

.success-box strong {
    color: #ffffff;
}

.link-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.link-box p {
    color: #ffffff;
}

.link-box input {
    margin: 10px 0;
}

.info-text {
    margin-top: 15px;
    color: rgba(255, 193, 7, 1);
    font-weight: 600;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.loading {
    text-align: center;
    padding: 40px;
}

.loading p {
    color: rgba(255, 255, 255, 0.9);
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-question,
.already-answered {
    text-align: center;
    padding: 40px 20px;
}

.no-question h2,
.already-answered h2 {
    color: #ffffff;
}

.no-question p,
.already-answered p {
    color: rgba(255, 255, 255, 0.9);
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                0 0 10px rgba(255, 215, 0, 0.2);
}

.user-info p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.9);
}

.question-text {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.6;
    margin: 20px 0;
    color: #ffffff;
}

#startSection {
    text-align: center;
    margin: 30px 0;
}

.timer {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    margin: 20px 0;
    padding: 15px;
    background: rgba(13, 71, 161, 0.3);
    border: 1px solid rgba(33, 150, 243, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.answer-summary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.answer-summary p {
    color: rgba(255, 255, 255, 0.9);
}

.answer-summary strong {
    color: #ffffff;
}

.answer-summary span {
    color: #ffffff !important;
}

.answer-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #ffffff;
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message h2 {
    color: #ffffff;
}

.success-message p {
    color: rgba(255, 255, 255, 0.9);
}

.success-message strong,
.success-message span {
    color: #ffffff !important;
}

footer {
    text-align: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-top: auto;
    width: 100%;
}

footer p {
    margin: 0;
}

/* reCAPTCHA styling */
.g-recaptcha {
    transform: scale(0.95);
    transform-origin: center;
}

/* Subtelne święta emoji w tle - STATYCZNE (bez rotacji) */
.container::before {
    content: '🎄';
    position: absolute;
    top: -30px;
    left: -30px;
    font-size: 80px;
    opacity: 0.08;
    z-index: -1;
}

.container::after {
    content: '🎁';
    position: absolute;
    bottom: -30px;
    right: -30px;
    font-size: 80px;
    opacity: 0.08;
    z-index: -1;
}

/* ============================================================================
   DESKTOP-ONLY PREMIUM ANIMATIONS (min-width: 1024px)
   ============================================================================ */

@media (min-width: 1024px) {
    /* Animacja świecenia ramki karty */
    .card {
        position: relative;
        animation: cardBorderGlow 4s ease-in-out infinite;
    }
    
    @keyframes cardBorderGlow {
        0%, 100% {
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                        0 0 30px rgba(255, 215, 0, 0.2),
                        inset 0 0 30px rgba(255, 255, 255, 0.05);
        }
        50% {
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
                        0 0 50px rgba(255, 215, 0, 0.4),
                        inset 0 0 30px rgba(255, 255, 255, 0.08);
        }
    }
    
    /* Efekt fali na karcie przy najechaniu */
    .card::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
        transform: translate(-50%, -50%);
        pointer-events: none;
        opacity: 0;
    }
    
    .card:hover::after {
        animation: cardWave 1.2s ease-out;
    }
    
    @keyframes cardWave {
        0% {
            width: 0;
            height: 0;
            opacity: 1;
        }
        100% {
            width: 800px;
            height: 800px;
            opacity: 0;
        }
    }
    
    /* Animacja tekstu h1 - świecenie */
    h1 {
        animation: h1TextGlow 3s ease-in-out infinite;
    }
    
    @keyframes h1TextGlow {
        0%, 100% {
            text-shadow: 0 0 15px rgba(255, 215, 0, 0.6),
                         0 0 25px rgba(255, 0, 0, 0.3),
                         0 2px 10px rgba(0, 0, 0, 0.5);
        }
        50% {
            text-shadow: 0 0 25px rgba(255, 215, 0, 0.8),
                         0 0 40px rgba(255, 0, 0, 0.5),
                         0 2px 15px rgba(0, 0, 0, 0.6);
        }
    }
    
    /* Animacja przycisków - fala i glow */
    .btn-primary, .btn-success {
        position: relative;
        overflow: hidden;
    }
    
    .btn-primary::after, .btn-success::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%);
        transition: none;
    }
    
    .btn-primary:hover::after, .btn-success:hover::after {
        animation: buttonRipple 0.8s ease-out;
    }
    
    @keyframes buttonRipple {
        0% {
            width: 0;
            height: 0;
            opacity: 1;
        }
        100% {
            width: 300px;
            height: 300px;
            opacity: 0;
        }
    }
    
    /* Animacja wchodzenia formularza */
    .form-group {
        animation: formGroupSlideIn 0.6s ease-out;
        animation-fill-mode: both;
    }
    
    .form-group:nth-child(1) { animation-delay: 0.1s; }
    .form-group:nth-child(2) { animation-delay: 0.2s; }
    .form-group:nth-child(3) { animation-delay: 0.3s; }
    .form-group:nth-child(4) { animation-delay: 0.4s; }
    .form-group:nth-child(5) { animation-delay: 0.5s; }
    
    @keyframes formGroupSlideIn {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* Input fields - focus glow */
    input[type="text"]:focus,
    input[type="email"]:focus,
    select:focus,
    textarea:focus {
        box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2),
                    inset 0 0 10px rgba(255, 215, 0, 0.1);
        animation: inputFocusGlow 0.4s ease-out;
    }
    
    @keyframes inputFocusGlow {
        from {
            box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4),
                        inset 0 0 0px rgba(255, 215, 0, 0);
        }
        to {
            box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2),
                        inset 0 0 10px rgba(255, 215, 0, 0.1);
        }
    }
    
    /* Success box - profesjonalna animacja */
    .success-box {
        animation: successBoxAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    @keyframes successBoxAppear {
        from {
            opacity: 0;
            transform: translate3d(0, 20px, 0) scale(0.9);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }
    }
    
    /* User info box - bounce entrance */
    .user-info {
        animation: userInfoBounceIn 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                    0 0 20px rgba(255, 215, 0, 0.3);
    }
    
    @keyframes userInfoBounceIn {
        0% {
            opacity: 0;
            transform: translate3d(0, -30px, 0) scale(0.8);
        }
        50% {
            transform: translate3d(0, 5px, 0) scale(1.05);
        }
        100% {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }
    }
    
    /* Question text - fade and scale */
    .question-text {
        animation: questionTextAppear 0.8s ease-out;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                    0 0 20px rgba(255, 255, 255, 0.1);
    }
    
    @keyframes questionTextAppear {
        from {
            opacity: 0;
            transform: translate3d(0, 10px, 0) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale(1);
        }
    }
    
    /* Spinner - improved animation */
    .spinner {
        animation: spinEnhanced 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    }
    
    @keyframes spinEnhanced {
        0% {
            transform: rotate(0deg) scale(1);
            box-shadow: 0 0 0 rgba(255, 215, 0, 0.5);
        }
        50% {
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
        }
        100% {
            transform: rotate(360deg) scale(1);
            box-shadow: 0 0 0 rgba(255, 215, 0, 0.5);
        }
    }
    
    /* Gradient button hover effect */
    .btn-primary:hover, .btn-success:hover {
        animation: buttonGradientShift 1s ease-in-out infinite;
    }
    
    @keyframes buttonGradientShift {
        0%, 100% {
            background: linear-gradient(135deg, #0a8f08 0%, #c62828 50%, #ffd700 100%);
        }
        50% {
            background: linear-gradient(135deg, #0d9e0a 0%, #d32f2f 50%, #ffed4e 100%);
        }
    }
    
    /* Container - hover scale effect */
    .container {
        transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .container:hover {
        transform: scale(1.01);
    }
    
    /* Snowfall - polepszony na desktopie */
    body::before {
        animation: snowfallEnhanced 25s linear infinite;
    }
    
    @keyframes snowfallEnhanced {
        0% {
            transform: translate3d(0, -50px, 0) rotateZ(0deg);
            opacity: 0;
        }
        10% {
            opacity: 1;
        }
        90% {
            opacity: 1;
        }
        100% {
            transform: translate3d(200px, 100vh, 0) rotateZ(360deg);
            opacity: 0;
        }
    }
    
    /* Message slide in */
    .message {
        animation: messageSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    @keyframes messageSlideIn {
        from {
            opacity: 0;
            transform: translate3d(0, -15px, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }
    
    /* Link box - hover effect */
    .link-box {
        transition: all 0.3s ease;
    }
    
    .link-box:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                    0 0 20px rgba(255, 215, 0, 0.2);
        transform: translateY(-4px);
        border-color: rgba(255, 255, 255, 0.4);
    }
}

/* Optymalizacja wydajności - redukuj animacje na słabszych urządzeniach */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before,
    body::after {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    /* Zmniejsz ilość śnieżynek na mobile */
    body::before {
        content: '❄️  ❄️';
        letter-spacing: 100px;
        font-size: 16px;
        animation-duration: 25s;
    }
    
    .card {
        padding: 25px;
        border-radius: 16px;
    }
    
    .card::before {
        /* Zmniejsz rozmycie na mobile dla wydajności */
        filter: blur(4px);
        opacity: 0.1;
    }
    
    h1 {
        font-size: 24px;
        letter-spacing: 0.5px;
    }
    
    .timer {
        font-size: 20px;
    }
    
    footer {
        font-size: 12px;
        padding: 10px 15px;
    }
    
    /* reCAPTCHA responsive */
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center;
    }
    
    
    .container::before,
    .container::after {
        font-size: 60px;
    }
}

/* Dodatkowa optymalizacja dla bardzo małych ekranów */
@media (max-width: 480px) {
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .card::before {
        /* Jeszcze mniejsze rozmycie na małych ekranach */
        display: none;
    }
    
    /* Uprość animacje na bardzo małych urządzeniach */
    body::before,
    .container::before,
    .container::after {
        display: none;
    }
}
