/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    --accent: rgb(0, 115, 170);
    --accent-hover: #005a87;
    --animation-duration: 0.25s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: background 0.2s, transform 0.2s, opacity 0.2s;
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinner-rotate {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== БАЗОВЫЕ КНОПКИ ===== */
.fssp-btn {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-fast);
}

.fssp-btn:hover {
    transform: translateY(-1px);
}

.fssp-btn:active {
    transform: translateY(0);
}

/* Цветовые модификаторы */
.fssp-btn-primary,
.fssp-btn-info {
    background: #17a2b8;
    color: #fff;
}

.fssp-btn-primary:hover,
.fssp-btn-info:hover {
    background: #138496;
}

.fssp-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.fssp-btn-secondary:hover {
    background: #5a6268;
}

.fssp-btn-success {
    background: #28a745;
    color: #fff;
}

.fssp-btn-success:hover {
    background: #218838;
}

.btn-disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.5;
    pointer-events: none;
}

/* ===== КНОПКИ "ПРОДОЛЖИТЬ" ===== */
.fssp-continue-btn {
    padding: 6px 16px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.fssp-continue-btn:hover {
    background: var(--accent-hover);
}

.fssp-continue-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.fssp-continue-btn:active {
    transform: scale(0.96);
}

/* ===== БЕЙДЖИ ===== */
.fssp-generated-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #28a745;
    color: #fff;
    font-weight: bold;
    animation: slideIn 0.3s ease;
}

/* ===== ТАБЛИЦА ===== */
.fssp-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 20px;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s ease;
}

.fssp-results-table th,
.fssp-results-table td {
    padding: 12px 10px;
    border: 1px solid #ddd;
    vertical-align: top;
    text-align: left;
}

.fssp-results-table thead {
    background: #f5f5f5;
    font-weight: 600;
}

.fssp-results-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

.fssp-results-table .text-muted {
    color: #666;
    font-style: italic;
}

.fssp-results-table td[style*="pre-line"] {
    white-space: pre-line;
}

/* Обёртка таблицы */
.fssp-results-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    animation: fadeIn 0.3s ease;
}

/* Колонки */
.fssp-col-num {
    text-align: center;
    width: 50px;
    font-weight: bold;
}

.fssp-col-hidden {
    display: none;
}

.fssp-cell-blurred {
    filter: blur(8px);
    user-select: none;
}

.fssp-cell-debts {
    white-space: pre-line;
}

.fssp-cell-action {
    text-align: center !important;
}

.fssp-cell-disabled {
    color: #999;
}

/* Цвета строк */
.fssp-row-generated {
    background: rgba(40, 167, 69, 0.2) !important;
}

.fssp-row-available {
    background: rgba(0, 128, 0, 0.15) !important;
}

.fssp-row-unavailable {
    background: rgba(255, 0, 0, 0.15) !important;
}

/* ===== КОНТЕЙНЕРЫ ===== */
.fssp-actions-container,
.fssp-step-container,
.fssp-result-row,
#notification-date-section,
div#wraper-adres_otpravitely {
    transition: all 0.3s ease;
}

.fssp-notification-days{
    display: block;
    margin-top: 5px;
    font-size: 12px;
    animation: fadeIn 0.3s ease;
}

#fssp-show-all-container,
.fssp-show-all-container {
    transition: opacity 0.3s ease;
}

/* ===== ПОЛЯ ФОРМЫ ===== */
.wrapper-terr-organ {
    display: flex;
    flex-direction: column;
    width: 50%;
}

.form-field-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

select[disabled],
input[disabled],
label:has(input:disabled) {
    cursor: not-allowed !important;
}

.form-disabled-message {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* ===== СООБЩЕНИЯ ===== */
.fssp-lock-message {
    margin: 15px 0;
    padding: 10px;
    background: #d4e5ff;
    white-space: pre-line;
    color: var(--accent);
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

.fssp-email-message,
.fssp-success-message {
    margin-top: 10px;
    font-size: 13px;
    animation: fadeIn 0.3s ease;
}

.fssp-email-message {
    color: #28a745;
}

.fssp-success-message {
    color: #666;
}

.fssp-hint-error {
    color: red;
}

.fssp-hint-warning {
    color: #ffc107;
}

.fssp-hint-success {
    color: #28a745;
}

.fssp-no-results {
    color: #666;
    padding-top: 20px;
    animation: fadeIn 0.3s ease;
}

.fssp-hint-error,
.fssp-hint-warning,
.fssp-hint-success {
    animation: slideIn 0.3s ease;
}

/* ===== ТАЙМЕР ===== */
.fssp-download-timer {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
    animation: fadeIn 0.3s ease;
}

/* ===== АНИМАЦИИ ПОЯВЛЕНИЯ/ИСЧЕЗНОВЕНИЯ ===== */
body.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-out,
.fssp-results-table tr.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.hidden-row {
    height: 0;
    overflow: hidden;
    padding: 0 !important;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease;
}

.fssp-result-row.fade-out-collapse {
    opacity: 0;
    transform: scale(0.98);
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0;
    border: none;
    overflow: hidden;
    pointer-events: none;
    transition: opacity var(--animation-duration) var(--animation-easing),
        transform var(--animation-duration) var(--animation-easing),
        max-height 0.35s var(--animation-easing),
        padding 0.35s var(--animation-easing);
}

/* ===== СПИННЕР ===== */
.spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.spinner-path {
    stroke: #0073aa;
    stroke-linecap: round;
    animation: spinner-rotate 1.2s linear infinite;
    will-change: stroke-dasharray, stroke-dashoffset;
}

.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loading-text {
    margin: 0;
    color: #555;
    font-size: 14px;
}

/* ===== КОМПОНЕНТЫ ФИО ===== */
.wrapper_fio {
    display: flex;
    width: 100%;
    gap: 10px;
}

.wrapper_f,
.wrapper_i,
.wrapper_o,
.wrap-email {
    width: 100%;
    display: flex;
    flex-direction: column;
}

select#gender {
    border: none !important;
    background-color: #fff;
    font-size: 100%;
    padding: 0;
    width: auto;
    height: auto;
}

select,
small,#district-match-hint {
    margin: 0;
    margin-left: 17px;
    /* margin: 4px 0 4px 17px; */
}

.warning-small {
    display: block;
    margin: 0;
}

/* ===== ОШИБКИ ВАЛИДАЦИИ ===== */
.fssp-error {
    box-shadow: inset 0 0 0px 1px red !important;
    border-color: red !important;
}

.fssp-error-message {
    color: red;
    font-size: 12px;
    display: block;
    margin: 0;
    margin-left: 17px;
    /* margin: 4px 0 4px 17px; */
    width: 100%;
}

/* ===== РАЗНОЕ ===== */
#mainForm label p {
    margin: 0;
}

label:empty {
    display: none;
}

.full-width-block {
    display: block;
    width: 100%;
}

.info-svg-item {
    display: flex;
    flex-direction: column;
}

.info-svg-icon {
    display: inline-flex;
    cursor: pointer;
    color: var(--accent);
    transition: color 0.2s;
    align-items: center;
    width: 100%;
}

.info-svg-info {
    transform: scale(1, 0);
    transition: 0.3s;
    margin: 0;
    padding: 0;
    font-size: 0;
    background: #fff;
    width: 100%;
}

.info-svg-info.visible {
    transform: scale(1, 1);
    font-size: 16px;
    display: flex;
    padding: 10px 12px;
    border: 1px solid #ccc;
}

svg.info {
    cursor: pointer;
}

.wave-circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    opacity: 0;
    animation: wave 10s infinite;
}

.flex {
    display: flex;
}

.column {
    flex-direction: column;
}

fieldset label.form-fssp {
    margin: 10px;
    margin-bottom: 0;
    width: 100%;
}

.validity {
    color: red;
    font-size: 12px
}

.deadline-hint {
    display: none;
    margin: 5px 0 0 0;
    font-size: 12px;
}

.fsspcheckeng {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden !important;
}

#fssp-selected-record-info {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #0073aa;
    margin-bottom: 20px
}

@keyframes wave {
    0% {
        r: 15;
        opacity: 0;
        stroke-width: 0;
    }

    50% {
        r: 25;
        opacity: 1;
        stroke-width: 1;
    }

    100% {
        r: 30;
        opacity: 0;
        stroke-width: 0;
    }
}

.wrap-form-fssp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    visibility: hidden;
    height: 0;
    width: 0;
    overflow: hidden
}

/* Универсальные переходы для часто изменяемых элементов */
.fssp-result-row,
.fssp-continue-btn,
.fssp-generated-badge {
    will-change: transform, opacity;
    transition: opacity var(--animation-duration) var(--animation-easing),
        transform var(--animation-duration) var(--animation-easing),
        background-color 0.2s ease;
}

/* Дополнительные контейнеры */
.fssp-step2-container {
    animation: slideUp var(--animation-duration) var(--animation-easing) forwards;
}

.fssp-result-row--selected {
    background: rgba(23, 162, 184, 0.15) !important;
}

.fssp-result-row--generated {
    background: rgba(40, 167, 69, 0.2) !important;
}

#fssp-results-container {
    transition: opacity 0.25s ease;
    opacity: 1;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .fssp-results-table {
        font-size: 13px;
    }

    .fssp-results-table th,
    .fssp-results-table td {
        padding: 8px 6px;
    }

    /* Скрыть колонку адреса на мобильных */
    .fssp-results-table td:nth-child(2),
    .fssp-results-table th:nth-child(2) {
        display: none;
    }

    .fssp-result-row {
        transition-duration: 0.2s;
    }
    #wraper-adres_otpravitely{
        width: 100%;
    }
    .wrapper-all-adres{
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .wrapper_fio {
        flex-direction: column;
    }

    .wrapper-terr-organ {
        width: 100%;
    }
}

/* === localStorage (TTL 24ч): маленькая пометка о времени генерации/исчезновения документа === */
.fssp-doc-time-note {
    display: block;
    font-size: 10px;
    line-height: 1.3;
    color: #888;
    margin-top: 4px;
    font-weight: normal;
}