body {
    font-family: Montserrat, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    height: 100vh;
    margin: 0;
    background-color: #f8f8f8;
    /* overflow: hidden; */
}

.container {
    max-width: 100%;
    text-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 90vh;
    margin: 24px;
    padding-bottom: 24px;
    padding-top: 24px;
}

h1 {
    font-size: 24px;
    margin-bottom: 14px;
    font-weight: 700;
}

h3 {
    font-size: 14px;
    font-weight: 300;
}

img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

img.fade-in {
    opacity: 1;
}

.loading {
    width: 100%;
    height: 70vh;
    aspect-ratio: 3/4;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    background-color: #f5f5f5;
    overflow: hidden;
}

.loading::before {
    content: "";
    width: 48px;
    height: 48px;
    border: 3px solid #ddd;
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s infinite ease-in-out;
    margin-bottom: 15px;
}

.loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
    animation: fade 1.5s infinite alternate;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fade {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    touch-action: manipulation;
}

button:hover {
    background-color: #333;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.error {
    color: #e74c3c;
    padding: 20px;
    background-color: #fdecea;
    border-radius: 8px;
    margin-bottom: 20px;
    max-width: 90%;
}

.hidden {
    display: none;
}

/* Style dla modalu email */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    touch-action: manipulation;
    /* backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); */
    box-sizing: border-box;
    padding: 10px;
}

.modal.visible {
    opacity: 1;
    transform: translateY(0);
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    position: relative;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#terms-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #000;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0;
    position: relative;
    flex-shrink: 0;
    z-index: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#terms-checkbox:checked {
    background-color: #000;
    border-color: #000;
}

#terms-checkbox:checked::before {
    content: "\2713";
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

label[for="terms-checkbox"] {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 30px 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
    touch-action: manipulation;
    overflow-y: auto;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    margin: 0;
}

.modal.visible .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 500;
    color: #333;
}

#email-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 0 auto;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
}

#email-input,
#name-input,
#company-input,
#phone-input {
    width: 80%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

#email-input:focus,
#name-input:focus,
#company-input:focus,
#phone-input:focus {
    border-color: #333;
}

#email-submit {
    margin: 10px auto 0;
    width: 180px;
    padding: 14px 24px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: transform 0.2s, background-color 0.2s;
    text-align: center;
    justify-content: center;
    touch-action: manipulation;
}

#email-submit:hover:not(:disabled) {
    transform: translateY(-2px);
}

#email-submit:active:not(:disabled) {
    transform: translateY(1px);
}

/* Style dla komunikatu o sukcesie */
#email-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    margin: 0 auto 20px;
    animation: scaleIn 0.5s ease-out;
}

#email-success h2 {
    color: #4CAF50;
    margin-bottom: 15px;
}

#email-success p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

/* Style dla modalu z regulaminem */
.terms-modal-content {
    max-width: 600px;
    max-height: 80vh;
    padding: 30px;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.terms-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    margin: 0;
    touch-action: manipulation;
}

.close-btn:hover {
    color: #000;
    background: none;
}

.terms-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.terms-content h3 {
    font-size: 18px;
    font-weight: 500;
    margin-top: 25px;
    margin-bottom: 10px;
}

.terms-content p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #555;
}

.terms-footer {
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

#accept-terms-btn {
    width: auto;
    padding: 12px 30px;
}

#terms-link {
    color: #0066cc;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 2px;
}

#terms-link:hover {
    text-decoration: underline;
}

/* Poprawki dla urządzeń mobilnych */
@media (max-width: 480px) {
    .terms-modal-content {
        padding: 20px;
    }

    .terms-content {
        max-height: 50vh;
    }

    .modal-content {
        padding: 25px 15px;
        width: 95%;
    }

    #email-input {
        font-size: 16px;
        /* Zapobiega powiększaniu się na iOS */
    }

    .checkbox-container {
        margin-bottom: 20px;
    }

    #terms-checkbox {
        width: 28px;
        height: 28px;
    }

    #terms-checkbox:checked::before {
        font-size: 20px;
    }

    label {
        font-size: 16px;
    }

    /* Większy obszar klikania dla przycisków na urządzeniach mobilnych */
    button,
    #accept-terms-btn,
    #close-terms-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Większy obszar klikania dla checkboxa */
    .checkbox-container {
        padding: 8px 0;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px 15px;
        width: 95%;
    }

    #email-input,
    #name-input,
    #company-input,
    #phone-input {
        padding: 10px;
        font-size: 14px;
        width: 80%;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    h3 {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .checkbox-container {
        font-size: 14px;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}