/* ============================
   Основные стили
============================ */

:root {
    --tg-bg: var(--tg-theme-bg-color, #f4f6f8);
    --tg-text: var(--tg-theme-text-color, #1c1c1e);
    --tg-hint: var(--tg-theme-hint-color, #8e8e93);
    --tg-button: var(--tg-theme-button-color, #2aabee);
    --tg-button-text: var(--tg-theme-button-text-color, #ffffff);
    --tg-secondary-bg: var(--tg-theme-secondary-bg-color, #ffffff);
    --tg-border: rgba(0, 0, 0, 0.08);
}

body {
    display: flex;
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f2f3f5;
    color: #1c1c1c;
    font-size: 16px;
    justify-content: center;
}

body.no-scroll {
    overflow: hidden;
    height: 100dvh;
}

#all-app {
    width: 100%;
    max-width: 700px;
    min-height: 100dvh;
    background: white;

    margin: 0 auto; /* 🔥 центрирует */
}


.block,
.popup,
.app,
.app2 {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}


button {
    cursor: pointer;
    border: none;
    outline: none;
}

textarea, input, select {
    display: block;
    font-family: inherit;
    font-size: 16px;
    padding: 8px 12px ;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background-color: #fff;
}

.date-input {
    width: 92%;
    max-width: 100%;
}

/* ============================
   Start Window (Главный экран)
============================ */
#start-window {
    display: flex;
    flex-direction: column;
    align-items: center;
    /*height: 100vh;*/
    height: 100dvh;
    padding: 16px;
    box-sizing: border-box;
    background-color: #ffffff;
}

#start-window__content{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;

}

#start-group .button {
    font-size:18px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    /*max-width: 360px;*/
    margin-top: 20px;

}

.btn-group button {
    width: 360px;
}

.button {
    background-color: #0078d4;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.button:hover {
    background-color: #005ea2;
}

/* ============================
   Popup full screen (id="popup" и id="cv-popup")
============================ */
.block {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /*width: 100%;*/
    width: min(100%, 700px);
    height: 100dvh;
    margin: 0 auto;
    background-color: #ffffff;
    z-index: 1000;
    /*overflow: auto;*/
    flex-direction: column;
    padding: 16px;
    box-sizing: border-box;
}

#cv-popup.block {
    padding: 0;
}

.block.active {
    display: flex;
}

.block-content {
    display: flex;           /* включаем flex */
    flex-direction: column;  /* вертикальное расположение дочерних элементов */
    gap: 12px;               /* расстояние между элементами по вертикали */
    background: var(--tg-secondary-bg);
    border-radius: 18px;
    /*padding: 18px;*/
    padding-left: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.block-scroll {
    max-height: 65dvh;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    padding-right: 4px; /* для скролла */
    padding-left: 3px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.download-block{
    display: flex;
    flex-direction: column;
    /*width: min(100%, 700px);*/
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    gap: 12px;

}
.download-block .button {
    width: 100%;
}

.block-scroll .form-group,
.block-scroll .works-info,
.block-scroll .almamaters-info,
/*.block-scroll .download-block,*/
.block-scroll .img-wrap {
    margin-bottom: 12px;
}


#language-select{
    display:block;
    width:100%;
    height:48px;
    min-height:48px;
    padding:0 12px;
    font-size:16px;
    box-sizing:border-box;
    flex-shrink:0;
}

/* ============================
   Изображение логотипа
============================ */
.img-wrap {
    position: relative;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.img-box {
    background-color: #e1e1e1;
    width: 100%;
    height: auto;
    flex-grow: 1;
    flex-shrink: 0;
    min-height: 150px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============================
   Чекбоксы-слайдеры
============================ */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    /*margin: 8px 0;*/
}

.switch-group{
    display: flex;
    flex-direction: row;

    gap: 12px;
}

#cv-switch{
    margin-top: 10px;
    margin-bottom: 20px;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 12px;
    margin-right: 8px;
    position: relative;
    transition: background-color 0.3s;
}

.custom-checkbox::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox {
    background-color: #0078d4;
}

.checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox::after {
    transform: translateX(20px);
}

/* ============================
   Прокрутка контента в cv-popup
============================ */

.form-group{
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.almamaters-info,
.works-info,
.courses-info{
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 12px;
    background-color: #f9f9f9;
}

/* ============================
   Кнопки загрузки фото
============================ */
.btn-box {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.text-box {
    display: flex;
    overflow-y: auto;
    width: 100%;
    height: 200px;
    font-size: 16px;
    color: #555;
}

.transparent-true {
    background-color: rgba(0,0,0,0.05);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transparent-true:hover {
    background-color: rgba(0,0,0,0.1);
}

/* ============================
   Кнопки отправки CV
============================ */
#btn {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 8px 0;
}

#photoPlace, #cv-photoPlace {
    display: flex;
    flex-direction: column;       /* вертикальное расположение элементов */
    align-items: center;          /* по центру по горизонтали */
    width: 100%;
    gap: 12px;                    /* расстояние между картинкой и текстом */
}

#cv-photoPlace {
    width: 40%;
    height: auto;
    margin: 0 auto;

}

/* Картинка по центру */
#photoPlace .img-box {
    width: 150px;                 /* задаём размер картинки */
    height: auto;
    background-color: #e1e1e1;    /* временный фон для визуализации */
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Текст выравниваем по левому краю */
#photoPlace .text-box {
    width: 100%;                  /* занимать всю ширину контейнера */
    text-align: left;             /* текст слева */
}

.button-block {
    display: flex;
    flex-direction: column;
    gap: 5px;               /* расстояние между кнопками */
    width: 100%;             /* растягиваем блок на всю ширину родителя */
    padding: 0 16px;         /* опционально, отступы от краев экрана */
    box-sizing: border-box;
}

.button-block > .button{
    font-size: 16px;
}

/*.btn{*/
/*    font-size: 22px;*/
/*}*/

.button-block .button, .btn .button {
    flex: 1;
    text-align: center;
    font-size: 16px;
}

/* ============================
   Всплывающие окна для альма-матер и работы
============================ */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: min(100%, 700px);
    /*width: 100%;*/
    margin: 0 auto;
    height: 100dvh;
    background-color: #ffffff;
    z-index: 1200;
    flex-direction: column;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.popup-content {
    display: flex;
    flex-direction: column; /* элементы вертикально */
    gap: 10px;
    width: 90%;
    max-width: 420px;
    background: var(--tg-secondary-bg);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    animation: popupShow 0.2s ease;
}

#offerText-popup{
    overflow-y: auto;
}

#almamaters-popup {
    background-color: rgba(200, 200, 200, 0.7); /* белый с прозрачностью */
}
#works-popup{
    background-color: rgba(200, 200, 200, 0.7);
}
#alma-edit-popup {
    background-color: rgba(200, 200, 200, 0.7);
}
#works-edit-popup{
    background-color: rgba(200, 200, 200, 0.7);
}
/*, , . */
.date-block {
    display: flex;
    gap: 10px;
}

.date-block .form-group,
.date-block .little-form-group {
    flex: 1;
}
/*#almamaters-popup {*/
/*    z-index: 20000;*/
/*}*/


@keyframes popupShow {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* ============================
   Вакансии и департаменты
============================ */
.app, .app2{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /*width: 100%;*/
    width: min(100%, 700px);
    margin: 0 auto;
    height: 100dvh;
    background-color: #ffffff;
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.screen {
    display:none;
    padding-left: 10px;
    /*padding:16px;*/

}

.screen.active {
    display:block;
}

#departments-list, #vacancies-list {
    display: flex;
    flex-direction: column;   /* если внутри несколько элементов */
    height: 90vh;
    padding-bottom: 20px;
    padding-top: 10px;
    min-height: 0;
    overflow-y: auto;         /* вертикальная прокрутка при переполнении */
    /*padding: 16px;*/
    box-sizing: border-box;
}


/*.back-btn {*/
/*    background-color: transparent;*/
/*    font-size: 20px;*/
/*    padding: 6px 12px;*/
/*    color: #0078d4;*/
/*}*/

.title {
    text-align: center;
    font-weight: 600;
}

/* ============================
   Мелкие правки
============================ */
h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.label {
    font-size: 14px;
}

textarea {
    resize: vertical;
}

/* =========================
   SELECT
========================= */
.custom-select {
    width:100px;
    padding: 0 12px;
    /*margin: 10px 0;*/
    border-radius: 12px;
    border: 1px solid #dce1e6;
    font-size: 18px;
    outline: none;
    line-height: normal;
}

.custom-select:focus {
    border-color: #2AABEE;

}

.department{
    padding:16px;
    margin-bottom:10px;
    border-radius:12px;
    background:#f4f6f9;
    font-size:16px;
    cursor:pointer;
    transition:0.2s;
}

.department:active{
    transform:scale(0.98);
}

.dynamic-btn.active-touch {
    background-color: #258bd1;
    transform: scale(0.98);
}

#departments-list, #vacancies-list{
    padding-right: 16px;
}

/* header */

.header{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:16px;
}

.back-btn{
    border:none;
    background:#f0f0f0;
    width:36px;
    height:36px;
    border-radius:8px;
    font-size:18px;
    cursor:pointer;
}

/* vacancies */

.vacancy{
    border-radius:12px;
    background:#f7f8fa;
    padding:14px;
    margin-bottom:10px;
    cursor:pointer;
}

.vacancy-title{
    font-weight:600;
}

/* details */

.details{
    max-height:0;
    overflow:hidden;
    transition:max-height 0.35s ease;
}

.details.open{
    max-height:300px;
    margin-top:10px;
}

.details-text{
    font-size:14px;
    color:#555;
    margin-bottom:10px;
}

.apply-btn{
    width:100%;
    padding:10px;
    border:none;
    border-radius:10px;
    background:#2ea6ff;
    color:white;
    font-size:14px;
}

.lang-group{
    display:flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    /*margin-bottom: 200px;*/
    margin-top: 10px;
    font-size: 18px;
}

/*#lang, #lang-select{*/
/*    width:100px;*/
/*}*/
#language-select{
    display:flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
    margin-left: 0;
    gap: 12px;
    width: 100%;
}

#loader {
    width: 60px;
    height: 60px;
    border: 4px solid #ddd;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    /*visibility: hidden;*/
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    visibility: hidden;
}

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /*width: 100%;*/
    width: min(100%, 700px);
    height: 100dvh;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.5); /* полупрозрачный фон */

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #eee;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.switch {
    position: relative;
    display: flex;
    width: 100%;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}

/* скрываем radio */
.switch input {
    display: none;
}

/* кнопки */
.switch label {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    cursor: pointer;
    z-index: 2;
    font-weight: 500;
    color: #333;
    transition: color 0.3s;
}

/* сам слайдер */
.switch .slider {
    position: absolute;
    width: 50%;
    height: 100%;
    background: #3498db;
    border-radius: 12px;
    transition: transform 0.3s ease;
    z-index: 1;
}

/* активный текст */
#login:checked ~ label[for="login"],
#register:checked ~ label[for="register"] {
    color: white;
}

/* движение слайдера */
#register:checked ~ .slider {
    transform: translateX(100%);
}

/* активный текст */
#enterCV:checked ~ label[for="enterCV"],
#downloadCV:checked ~ label[for="downloadCV"] {
    color: white;
}

/* движение слайдера */
#downloadCV:checked ~ .slider {
    transform: translateX(100%);
}



#authorization input {
    margin-bottom: 10px; /* 🔥 убираем всё лишнее */
}
#authorization{
    display: flex;
    flex-direction: column;
    margin-top: 10px; /* отступ сверху от картинки */
    margin-bottom: 10px;
}

#confirmation{
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

#confirmation .switch-group{
    margin-top: 10px;
}

#confirmation .button-block{
    margin-top: 14px;

}

.employment{
    display: flex;
    flex-direction: column;
    width: 100%;

}

#birtsday{
    width: 100%;
}