@import url('colors.css');

/* ============================
   1. ЗАГОЛОВКИ И ТЕКСТ
   ============================ */

/* Основной заголовок */
.reg-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 20px 0;
    line-height: 1.2;
}

/* Подзаголовок */
.reg-subtitle {
    font-size: 18px;
    color: var(--color-text-primary);
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* Мелкий текст */
.reg-small-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Очень мелкий текст */
.reg-tiny-text {
    font-size: 12px;
    color: var(--color-text-gray);
    line-height: 1.3;
}

/* Выделенный текст */
.text-primary {
    color: var(--color-primary-green);
    font-weight: 600;
}

/* Описание вероятности */
.probability-description {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--color-text-gray);
}

.probability-left {
    font-weight: 400;
}

.probability-right {
    font-weight: 600;
}

/* ============================
   КАСТОМНЫЕ СЕЛЕКТЫ
   ============================ */

.custom-select {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.custom-select select {
    display: none;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--color-border-gray);
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-height: 56px;
    box-sizing: border-box;
}

.custom-select-trigger:focus,
.custom-select.open .custom-select-trigger {
    border-color: var(--color-primary-green);
    outline: none;
}

.custom-select-trigger:focus + .floating-label,
.custom-select.open .custom-select-trigger + .floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--color-primary-green);
    font-weight: 500;
}

.custom-select .floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-gray);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 4px;
    z-index: 1;
}

.custom-select .floating-label.float {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 500;
}

.custom-select-placeholder {
    color: var(--color-text-gray);
    opacity: 0;
}

.custom-select-value {
    color: var(--color-text-primary);
}

.custom-select-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--color-text-gray);
    transition: transform 0.2s ease;
    margin-left: 10px;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #78797980;
    border-radius: 16px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-select.open .custom-select-dropdown {
    display: block;
}

.custom-select-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.custom-select-option:hover {
    background-color: #f8f9fa;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option.selected {
    background-color: var(--color-primary-green);
    color: white;
}

/* ============================
   ВЫБОР ПОЛА (РАДИО-КНОПКИ)
   ============================ */

.gender-selection {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.gender-radio {
    position: relative;
    width: 20px;
    height: 20px;
}

.gender-radio input[type="radio"] {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.gender-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.gender-radio input[type="radio"]:checked + .gender-radio-custom {
    border-color: var(--color-primary-green);
    background-color: var(--color-primary-green);
}

.gender-radio input[type="radio"]:checked + .gender-radio-custom::after {
    /*content: '';*/
    /*width: 6px;*/
    /*height: 6px;*/
    background-color: white;
    border-radius: 50%;
    display: block;
}

.gender-label {
    font-size: 16px;
    color: var(--color-text-dark);
    cursor: pointer;
}

/* ============================
   ПРОГРЕСС И СТАТИСТИКА
   ============================ */

/* Секция прогресса */
.progress-section {
    text-align: center;
    margin-bottom: 40px;
}

/* Статистика одобрения */
.approval-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.approval-boost {
    color: var(--color-primary-green);
    font-weight: 600;
}

.step-counter {
    color: var(--color-text-gray);
    font-weight: 400;
}

/* Прогресс-бар */
.progress-bar-container {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--color-primary-green);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============================
   2. ИНПУТЫ
   ============================ */

/* Базовые стили инпута */
.input-field {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--color-border-gray);
    border-radius: 16px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
    outline: none;
    color: var(--color-text-primary);
}

.input-field:focus + .floating-label {
    color: var(--color-primary-green);
}

/* Floating label */
.floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-gray);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 4px;
    z-index: 1;
}

/* Состояние поднятого label */
.floating-label.float {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 500;
}

/* Фокус на инпуте */
.input-field:focus {
    border-color: var(--color-primary-green);
}

.input-field:focus + .floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--color-primary-green);
    font-weight: 500;
}

/* Состояние ошибки */
.input-field.error {
    border-color: #ff4757;
}

.input-field.error + .floating-label {
    color: #ff4757;
}

.input-field:disabled + .floating-label {
    background: #f5f5f5;
}

/* Специальные типы инпутов */
.input-field--phone {
    letter-spacing: 1px;
}

.input-field--sms {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    padding: 20px;
    font-family: monospace;
}

.input-field--sms::placeholder {
    letter-spacing: normal;
}

.input-field--date {
    font-family: system-ui, -apple-system, sans-serif;
}

.input-field--file {
    padding: 0;
    border: none;
    background: transparent;
}

.input-field--select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Disabled состояние */
.input-field:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* ============================
   3. КНОПКИ
   ============================ */

/* Основная кнопка */
.btn-primary {
    background: var(--color-primary-green);
    border: none;
    border-radius: 16px;
    padding: 18px 24px;
    color: var(--color-text-white);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 20px;
    height: 58px;
    margin-bottom: 30px;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--color-btn-primary-hover);
}

.btn-primary:active {
}

.btn-primary:disabled {
    background: var(--color-text-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Вторичная кнопка */
.btn-secondary {
    background: rgba(68, 172, 20, 0.1);
    border-radius: 16px;
    padding: 10px 24px;
    color: var(--color-primary-green);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    line-height: 1;
}

.btn-secondary:hover {
    background: rgba(68, 172, 20, 0.3);
}

.btn-secondary:active {
}

.btn-secondary--big {
    padding: 13px 55px;
}

.btn-secondary--gray {
    background-color: var(--color-background-light);
    color: var(--color-text-gray);
}

.btn-secondary--gray:hover {
    background-color: var(--color-btn-secondary-hover);
    color: #fff;
}

.btn-secondary--primary {
    background-color: var(--color-primary-green);
    color: #fff;
}

.btn-secondary--primary:hover {
    background-color: var(--color-btn-primary-hover);
}

.info-text {
    padding: 12px;
    font-size: 12px;
    border-radius: 16px;
}

.info-text--blue { background-color: #F6FBFF; }
.info-text--red { background-color: rgba(218, 46, 53, 0.1); color: #DA2E35; }

.tag-secondary {
    background: rgba(68, 172, 20, 0.1);
    border-radius: 16px;
    padding: 4px 12px;
    color: var(--color-primary-green);
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
    display: inline-block;
}

.tag-secondary--gray {
    background-color: var(--color-background-light);
    color: var(--color-text-gray);
}

/* Текстовая кнопка */
.btn-text {
    background: none;
    border: none;
    color: var(--color-text-gray);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px;
    transition: color 0.2s ease;
    box-shadow: none;
}

.btn-text:hover {
    color: var(--color-btn-primary-hover);
    background: none;
}

/* Маленькая кнопка */
.btn-small {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 12px;
}

/* ============================
   4. ЧЕКБОКСЫ
   ============================ */

/* Группа чекбокса */
.checkbox-group {
    margin: 20px 0;
}

.checkbox-group--bg {
    background-color: #F6FBFF;
    padding: 10px;
    border-radius: 16px;
}

/* Лейбл чекбокса */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Контейнер чекбокса */
.checkbox-wrapper {
    position: relative;
    flex-shrink: 0;
}

/* Скрытый чекбокс */
.checkbox-input {
    opacity: 0;
    position: absolute;
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Кастомный чекбокс */
.checkbox-custom {
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 1px solid var(--color-border-gray);
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-custom.checked {
    background: var(--color-primary-green);
    border-color: var(--color-primary-green);
}

.checkbox-custom svg {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-custom.checked svg {
    opacity: 1;
}

/* Текст чекбокса */
.checkbox-text {
    font-size: 13px;
    color: var(--color-text-gray);
}

.checkbox-text a {
    color: var(--color-text-gray);
    text-decoration: underline;
}

.checkbox-text a:hover {
    color: var(--color-text-gray);
}

/* ============================
   5. УВЕДОМЛЕНИЯ
   ============================ */

/* Контейнер для фиксированных уведомлений */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 350px;
}

/* Базовые стили уведомления */
.notification {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #ddd;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Типы уведомлений */
.notification--success {
    border-left-color: var(--color-primary-green);
    background: #f0fff4;
    color: #276749;
}

.notification--error {
    border-left-color: #ff4757;
    background: #fff5f5;
    color: #c53030;
}

.notification--info {
    border-left-color: #3498db;
    background: #F6FBFF;
    color: #2c5aa0;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        font-size: 13px;
        padding: 14px 16px;
    }
}

/* Старые стили уведомлений (для совместимости) */
/* Сообщение об ошибке */
.message-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 12px 16px;
    color: #c53030;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Сообщение об успехе */
.message-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 12px 16px;
    color: #276749;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Информационное сообщение */
.message-info {
    background-color: #F6FBFF;
    padding: 12px;
    border-radius: 16px;
}

/* ============================
   6. СПЕЦИАЛЬНЫЕ КОМПОНЕНТЫ
   ============================ */

/* Блок финального успеха */
.success-final {
    text-align: center;
    padding: 30px 20px;
    background: var(--color-primary-green-10);
    border-radius: 16px;
    margin-bottom: 24px;
}

.success-final p {
    margin: 8px 0;
    color: var(--color-primary-green);
    font-size: 18px;
    font-weight: 600;
}

/* Заглушка для iframe */
.iframe-placeholder {
    margin: 20px 0;
}

.iframe-placeholder p {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-background-light);
    border-radius: 16px;
    color: var(--color-text-gray);
    font-size: 14px;
    line-height: 1.5;
}

.iframe-container {
    margin: 24px 0;
    border-radius: 16px;
    overflow: hidden;
    background: #ECF7E7;
    border: 2px solid var(--color-primary-green);
}

.iframe-container iframe {
    display: block;
    border: none;
}

/* Загрузочное состояние iframe */
.iframe-container.loading::after {
    content: "Загрузка формы добавления карты...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    color: var(--color-text-gray);
    font-size: 14px;
}

.file-upload {
    position: relative;
}

.file-input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 18px 20px;
    border: 2px dashed var(--color-border-gray);
    border-radius: 16px;
    text-align: center;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.file-label:hover {
    border-color: var(--color-primary-green);
    background: var(--color-primary-green-10);
    color: var(--color-primary-green);
}

/* Новые стили для загрузки файлов */
.upload-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.file-upload-area {
    background: #ECF7E7;
    border: 2px solid var(--color-primary-green);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.file-upload-placeholder {
    width: 120px;
    height: 80px;
    margin: 0 auto 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
}

.card-icon {
    font-size: 32px;
    opacity: 0.6;
}

.file-upload-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.file-upload-info {
    margin: 16px 0;
}

.upload-instruction {
    font-size: 13px;
    color: var(--color-text-gray);
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.upload-warning {
    background: #FFF5F5;
    color: #ff4757;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    border: 1px solid #ffebee;
}

.file-size-info {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-gray);
    margin-bottom: 24px;
}

/* Стили для превью загруженных файлов */
.file-preview {
    position: relative;
    display: inline-block;
}

.file-preview img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    object-fit: cover;
}

.file-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Состояние загруженного файла */
.file-upload-area.has-file {
    border-color: var(--color-primary-green);
    background: var(--color-primary-green-10);
}

.file-upload-area.has-file .file-upload-placeholder {
    background: rgba(68, 172, 20, 0.1);
    border-color: var(--color-primary-green);
}

/* Иконки пользователей */
.user-icons {
    display: flex;
    justify-content: center;
    gap: -8px;
    margin-bottom: 24px;
}

.user-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    border: 3px solid white;
    margin-left: -8px;
}

.user-icon:first-child {
    margin-left: 0;
}

.user-icon--green {
    background: var(--color-primary-green);
}

.user-icon--purple {
    background: #8B5CF6;
}

/* Выделенная группа инпута */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-field--highlighted {
    border: none;
    background: transparent;
    margin: 0;
}

.sms-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.timer-text {
    font-size: 14px;
    font-weight: 400;
    padding: 5px;
    color: var(--color-text-gray);
    margin: 0;
}

.timer-countdown {
    font-size: 16px;
    color: var(--color-primary-green);
    font-weight: 600;
}

@media (max-width: 768px) {
    .reg-title {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    .reg-subtitle {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    .input-field {
        padding: 16px 18px;
    }
    
    .btn-primary {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
}