/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Импорт шрифта Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'HalvarBreitschrift', 'Inter', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

/* Контейнер формы */
.loyalty-form-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    max-width: 100%;
}

/* Шаги формы */
.form-step {
    display: none !important;
    width: 100%;
    max-width: 100%;
    min-width: auto;
    height: 900px;
    background: transparent;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.form-step.active {
    display: block !important;
    animation: fadeIn 0.5s ease-out;
}

/* Заголовок формы */
.form-header {
    text-align: center;
    padding: 0;
    background: transparent;
    position: relative;
    margin: 0;
    width: 100%;
    border-radius: 0;
    min-width: 100%;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo img {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Контент формы */
.form-content {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.form-section {
    flex: 1;
    padding: 10px 30px 10px 30px;
    background: transparent;
    width: 100%;
    margin: 0;
    animation: slideInFromTop 0.6s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Форма */
.loyalty-form {
    width: 100%;
    max-width: 100%;
}

.input-group {
    margin-bottom: 25px;
    position: relative;
}

/* Стили для групп полей ввода Tilda */
.t-input-group {
    margin-bottom: 25px;
    position: relative;
}

.t-input-group:last-child {
    margin-bottom: 0;
}

.t-input-group.t-input-group_nm,
.t-input-group.t-input-group_ph,
.t-input-group.t-input-group_em,
.t-input-group.t-input-group_da {
    margin-bottom: 12px;
}

.t-input-group.t-input-group_cb {
    margin-bottom: 10px;
}

.t-input-block {
    position: relative;
    margin-bottom: 3px;
    padding-top: 8px;
    margin-top: 6px;
}

.input-block {
    position: relative;
    padding-top: 12px;
    margin-top: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 5px;
    color: #000000;
    font-size: 14px;
    font-family: 'HalvarBreitschrift', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.4;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.form-input:focus {
    outline: none;
    border-color: #8B4513;
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(139, 69, 19, 0.1);
}

/* Убираем стили для placeholder, так как используем кастомные плейсхолдеры */
.form-input::placeholder {
    color: transparent;
    opacity: 0;
}

/* Убираем плейсхолдеры */
.input-placeholder {
    display: none;
}

/* Подписи к полям */
.field-label {
    display: block;
    margin-bottom: 6px;
    color: #8B4513;
    font-size: 13px;
    font-weight: 600;
    font-family: 'HalvarBreitschrift', Arial, sans-serif;
}

/* Убираем дублирование стилей */

/* Дополнительные стили для плейсхолдера при фокусе */
.form-input:focus + .input-placeholder {
    opacity: 1;
    visibility: visible;
}

/* Иконка календаря */
.date-input {
    padding-right: 50px;
    cursor: pointer;
}

.date-input:hover {
    border-color: #8B4513;
}

.date-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: auto;
}

.date-input:hover ~ .date-icon {
    color: #8B4513;
    transform: translateY(-50%) scale(1.1);
}

.date-icon svg {
    fill: currentColor;
}

/* Контейнер для поля даты */
.t-input-group.t-input-group_da .t-input-block {
    max-width: 220px;
}

/* Чекбоксы */
.checkbox-group {
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.checkbox-control {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: #000000;
    position: relative;
    z-index: 10;
}

.checkbox-control input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.checkbox-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid #c9c9c9;
    border-radius: 2px;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: #fff;
    display: block;
    min-width: 18px;
    min-height: 18px;
}

.checkbox-control input[type="checkbox"]:checked + .checkbox-indicator {
    background: #8B4513;
    border-color: #8B4513;
}

.checkbox-indicator::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-control input[type="checkbox"]:checked + .checkbox-indicator::after {
    opacity: 1;
}

.checkbox-control span {
    color: #000000;
    display: inline-block;
    margin-left: 0;
}

.checkbox-control a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid #000000;
    box-shadow: none;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-control a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #8B4513;
    transition: width 0.3s ease;
}

.checkbox-control a:hover {
    color: #8B4513;
    border-bottom-color: #8B4513;
}

.checkbox-control a:hover::after {
    width: 100%;
}

/* Кнопки */
.submit-btn {
    width: 100%;
    padding: 12px 25px;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 5px;
    color: #000000;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'HalvarBreitschrift', Arial, sans-serif;
    letter-spacing: 1px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    display: block;
    z-index: 10;
    min-height: 40px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover {
    background: #8B4513;
    color: #fff;
    border-color: #8B4513;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

/* Ошибки */
.input-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.input-error.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

/* Шаги верификации */
#phoneStep.active, #confirmStep.active, #alreadyRegisteredStep.active {
    text-align: center;
    background: transparent;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: 400px;
    width: 100%;
}

#phoneStep h3, #confirmStep h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

#phoneStep p, #confirmStep p {
    color: #666;
    margin-bottom: 30px;
}

/* Успешное сообщение */
.success-message {
    text-align: center;
    padding: 60px 20px 40px 20px;
    background: #fff;
    position: relative;
}

.success-message::before {
    content: '✓';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: #8B4513;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    font-weight: bold;
}

.success-message h3 {
    font-size: 1.8rem;
    color: #8B4513;
    margin-bottom: 20px;
}

.success-message p {
    color: #666;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Сообщение о том, что уже зарегистрирован */
.already-registered-message {
    text-align: center;
    padding: 60px 20px 40px 20px;
    background: #fff;
    position: relative;
}

.already-registered-message::before {
    content: 'ℹ';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    font-weight: bold;
}

.already-registered-message h3 {
    font-size: 1.8rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.already-registered-message p {
    color: #666;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Стили для загрузки */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Стили для уведомлений */
.notification {
    animation: slideInRight 0.3s ease-out;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification-error {
    background: #ff6b6b !important;
}

.notification-info {
    background: #8B4513 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .form-step {
        max-width: 100%;
        min-width: auto;
        margin: 0;
    }
    
    .form-section {
        padding: 25px 20px;
    }
    
    .form-header {
        padding: 0;
        width: 100%;
        min-width: 100%;
        margin: 0;
    }
    
    .logo img {
        width: 100%;
    }
    
    .form-input:focus {
        transform: scale(1.02);
    }
    
    .submit-btn:active {
        transform: scale(0.98);
    }
}

@media (max-width: 480px) {
    .loyalty-form-container {
        padding: 10px;
    }
    
    .form-step {
        border-radius: 8px;
        min-width: auto;
    }
    
    .form-header {
        padding: 20px 15px 15px;
    }
    
    .logo img {
        width: 100%;
    }
    
    .form-input {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .t-input-group.t-input-group_nm,
    .t-input-group.t-input-group_ph,
    .t-input-group.t-input-group_em,
    .t-input-group.t-input-group_da {
        margin-bottom: 30px;
    }
    
    .input-group {
        margin-bottom: 30px;
    }
}

/* Дополнительные стили для профиля (если нужны) */
.profile-data {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

.profile-data h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #eee;
}

.profile-field label {
    font-weight: bold;
    color: #666;
}

.profile-field span {
    color: #333;
    font-family: monospace;
}

.xml-response {
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
}

.xml-container {
    width: 200%;
    max-width: 800px;
    margin: 0 auto;
}

/* Стили для кастомного датапикера */
.custom-datepicker {
    animation: fadeIn 0.3s ease-out;
}

.custom-datepicker select {
    font-family: 'HalvarBreitschrift', Arial, sans-serif;
}

.custom-datepicker select:focus {
    outline: none;
    border-color: #8B4513;
}

.calendar-day:hover {
    background: #f0f0f0 !important;
} 