@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

body {
    background-color: #f5f5dc;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    margin: 0;
    padding: 20px;
    transition: background-color 0.5s ease;
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    direction: ltr;
}

.logo {
    width: 120px;
}

.welcome {
    font-size: 2.5vmin;
    margin-bottom: 40px;
}

.language-options-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
}

.language-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
    min-width: min-content;
    padding: 0 10px;
}

.card {
    border-radius: 10px;
    overflow: hidden;
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.lang-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 10px;
}

.button {
    background-color: #000000;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 20px;
    width: 80%;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    width: 90vw;
    max-width: 600px;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.login-modal-content {
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
    margin: 0;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Стили для ошибок валидации */
.form-group input.error-field,
.form-group select.error-field {
    border-color: red;
}

.error-message {
    color: red;
    font-size: 12px;
    margin-top: 5px;
}

.error-message.show {
    display: block;
}

.action-button {
    background-color: #000000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.action-button:hover {
    background-color: #3d4f21;
}

.link-button {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    text-decoration: underline;
}

.role-modal-content {
    max-width: 800px;
}

.role-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.role-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    width: 200px;
    transition: transform 0.3s;
}

.role-option:hover {
    transform: scale(1.05);
}

.role-option img {
    width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.secret-key-modal-content {
    max-width: 400px;
}

.submit-button {
    background-color: #000000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background-color: #3d4f21;
}

.registration-modal-content {
    max-width: 600px;
}

.dashboard-box {
    background-color: #fefefe;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
    width: 90%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.documents-section {
    margin-top: 30px;
    text-align: left;
}

.documents-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.documents-section ul {
    list-style-type: none;
    padding: 0;
}

.documents-section li {
    margin-bottom: 5px;
}

.download-link {
    color: #000000;
    text-decoration: none;
}

.download-link:hover {
    text-decoration: underline;
}

.consent-container {
    margin-bottom: 15px;
    text-align: left;
}

.consent-text {
    font-size: 14px;
}

.consent-text a.policy-link {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}

.consent-text a.policy-link:hover {
    color: #0056b3;
    text-decoration: none;
}

.pdf-modal-content {
    max-width: 800px;
    height: 80%;
}

.checkbox {
    display: flex;
    align-items: flex-start;
}

.checkbox input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

[dir="rtl"] .language-options {
    flex-direction: row-reverse;
}
[dir="rtl"] .close {
    right: auto;
    left: 15px;
    float: left;
}
[dir="rtl"] .form-group {
    text-align: right;
}
[dir="rtl"] .role-options {
    flex-direction: row-reverse;
}
[dir="rtl"] .error-message {
    text-align: right;
}

.account-modal-content {
    max-width: 400px;
    padding: 40px;
}

/* Мобильная версия для language-options */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .welcome {
        font-size: 5vmin;
    }

    /* Мобильная версия для language-options */
    .language-options-container {
        overflow-x: visible;
    }

    .language-options {
        flex-direction: column;
        align-items: center;
        flex-wrap: wrap;
    }

    .card {
        width: 100%;
        max-width: 300px;
        margin-bottom: 15px;
    }

    .role-options {
        flex-direction: column;
        align-items: center;
    }

    .role-option {
        width: 100%;
        max-width: 250px;
    }

    .modal-content {
        padding: 15px;
    }

    .login-modal-content, .secret-key-modal-content, .account-modal-content {
        padding: 20px;
    }

    .login-image {
        max-width: 200px;
    }
}

.profile-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

/* Стили для select чтобы выглядел как input */
select.profile-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
}

select.profile-field:disabled {
    background-color: #f9f9f9;
    color: #666;
    cursor: not-allowed;
}

select.profile-field:not(:disabled) {
    background-color: #fff;
    color: #000;
    cursor: pointer;
}
.language-options-container {
    width: 100%;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
}

.language-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
    min-width: min-content;
    padding: 0 10px;
}

.card {
    border-radius: 10px;
    overflow: hidden;
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    touch-action: manipulation; /* Улучшает обработку касаний */
}

.button {
    background-color: #000000;
    color: white;
    border: none;
    padding: 15px 22px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 20px;
    width: 80%;
    touch-action: manipulation; /* Улучшает обработку касаний */
    min-height: 51px; /* Минимальная высота для удобства касания */
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .welcome {
        font-size: 5vmin;
    }

    .language-options-container {
        overflow-x: visible; /* Отключаем горизонтальную прокрутку */
    }

    .language-options {
        flex-direction: column;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px; /* Увеличиваем расстояние между карточками */
    }

    .card {
        width: 100%;
        max-width: 300px;
        margin-bottom: 15px;
        min-height: 100px; /* Увеличиваем высоту карточки */
    }

    .button {
        width: 90%; /* Увеличиваем ширину кнопки */
        padding: 15px; /* Увеличиваем область касания */
        font-size: 18px; /* Увеличиваем шрифт для читаемости */
        min-height: 56px; /* Увеличиваем высоту кнопки */
    }

    .role-options {
        flex-direction: column;
        align-items: center;
    }

    .role-option {
        width: 100%;
        max-width: 250px;
    }

    .modal-content {
        padding: 15px;
    }

    .login-modal-content, .secret-key-modal-content, .account-modal-content {
        padding: 20px;
    }

    .login-image {
        max-width: 200px;
    }
}
