/**
 * Стили для формы поиска лицевого счёта АО "Теплоэнергия"
 */

/* Контейнер виджета */
.as-container {
    max-width: 540px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

.as-container * {
    box-sizing: border-box;
}

/* Заголовок и иконка */
.as-header {
    text-align: center;
    margin-bottom: 24px;
}

.as-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.as-icon svg {
    width: 28px;
    height: 28px;
    stroke: #D97706;
}

.as-title {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.as-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Карточка формы */
.as-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

/* Поле ввода */
.as-field {
    margin-bottom: 20px;
}

.as-field:last-of-type {
    margin-bottom: 0;
}

.as-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
}

.as-step-badge {
    font-size: 11px;
    font-weight: 600;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    padding: 2px 9px;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

/* Кастомный select с оберткой */
.as-select-wrapper {
    position: relative;
    width: 100%;
}

.as-select {
    width: 100% !important;
    height: 48px !important;
    padding: 0 44px 0 16px !important;
    font-size: 15px !important;
    font-weight: 500;
    color: #1e293b !important;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23D97706' 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 14px center;
    background-size: 18px;
}

.as-select:hover:not(:disabled) {
    background-color: #ffffff;
    border-color: #F59E0B !important;
}

.as-select:focus {
    background-color: #ffffff;
    border-color: #F59E0B !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18) !important;
}

.as-select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8 !important;
    border-color: #e2e8f0;
    cursor: not-allowed;
    background-image: none;
}

/* Спиннер загрузки внутри select */
.as-spinner {
    display: none;
    position: absolute;
    right: 14px;
    top: calc(50% - 9px);
    width: 18px;
    height: 18px;
    border: 2.5px solid #FEF3C7;
    border-top-color: #D97706;
    border-radius: 50%;
    animation: as-spin 0.6s linear infinite;
    pointer-events: none;
}

@keyframes as-spin {
    to { transform: rotate(360deg); }
}

/* Анимация плавного появления полей */
.as-field-appear {
    animation: asFadeSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes asFadeSlide {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Сообщение об ошибке */
.as-error-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-top: 18px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-size: 13.5px;
    line-height: 1.4;
    animation: asFadeSlide 0.25s ease;
}

.as-error-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #ef4444;
}

/* Карточка результата (компактный вывод) */
.as-result-card {
    margin-top: 18px;
    padding: 16px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.as-result-appear {
    animation: asFadeSlide 0.25s ease forwards;
}

.as-result-line {
    font-size: 16px;
    color: #334155;
    margin-bottom: 12px;
    line-height: 1.4;
}

.as-result-line strong {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-left: 6px;
    letter-spacing: 0.5px;
}

.as-result-actions {
    margin-top: 0;
}

.as-reset-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.as-reset-button svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.as-reset-button:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Адаптивность для мобильных экранов */
@media (max-width: 540px) {
    .as-container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .as-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .as-title {
        font-size: 22px;
    }

    .as-reset-button {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
}
