/* ============================================================
   Стили для страницы проверки гарантии
   (вынесены из PHP-файла)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    background-color: #eef3f8;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    margin: 0;
}

.service-card {
    max-width: 1100px;
    width: 100%;
    background: #ffffff;
    border-radius: 2rem;
    box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.service-card:hover {
    box-shadow: 0 30px 55px -12px rgba(0, 0, 0, 0.25);
}

.service-header {
    background: linear-gradient(105deg, #124c66 0%, #1f6e8c 100%);
    padding: 2.5rem 3rem 2rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.service-header .badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    padding: 0.4rem 1.5rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #ffffff;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.service-header p {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.95;
    margin-bottom: 0;
}

.service-content {
    padding: 2.5rem 3rem 3rem;
}

.info-block {
    background: #f9fcfe;
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    border: 1px solid #e2edf2;
}

.block-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: #0f3b4f;
    display: inline-block;
}

.block-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.block-title-wrap .link-help {
    font-size: 0.9rem;
    color: #1d6f8b;
    cursor: pointer;
    text-decoration: underline dotted #1d6f8b;
    text-underline-offset: 3px;
    background: none;
    border: none;
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap;
}

.block-title-wrap .link-help:hover {
    color: #124c66;
}

.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f3b4f;
    margin-bottom: 0.25rem;
}

.field-group input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    border: 1.5px solid #cbdde6;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
}

.field-group input:focus {
    border-color: #1d6f8b;
    box-shadow: 0 0 0 4px rgba(29, 111, 139, 0.12);
}

.field-group input::placeholder {
    color: #95aec0;
}

.field-group .hint {
    font-size: 0.8rem;
    color: #5c7f8c;
    margin-top: 0.2rem;
    padding-left: 0.2rem;
}

.field-group .example {
    font-size: 0.8rem;
    color: #1d6f8b;
    margin-top: 0.1rem;
    font-weight: 500;
}

.search-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 0.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #d4e2ec;
    justify-content: flex-end;
}

.search-actions .captcha-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    background: #eef3f8;
    padding: 0.4rem 1.2rem 0.4rem 1.5rem;
    border-radius: 40px;
    flex-shrink: 0;
}

.search-actions .captcha-wrapper span {
    font-weight: 500;
    font-size: 1rem;
    color: #0f3b4f;
}

.search-actions .captcha-wrapper input {
    width: 64px;
    padding: 0.4rem 0.5rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #fff;
}

.search-actions .captcha-wrapper input:focus {
    border-color: #1d6f8b;
    box-shadow: 0 0 0 3px rgba(29, 111, 139, 0.1);
}

.search-actions .captcha-wrapper .captcha-error {
    color: #c0392b;
    font-size: 0.8rem;
    font-weight: 500;
}

.search-actions .btn-primary {
    background: #1d6f8b;
    color: #fff;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1.05rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(29, 111, 139, 0.25);
    flex-shrink: 0;
}

.search-actions .btn-primary:hover {
    background: #165a72;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(29, 111, 139, 0.35);
}

.search-actions .btn-primary:active {
    transform: translateY(0);
}

.search-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    padding: 0.8rem 1.5rem;
    border-radius: 1rem;
    margin-top: 1.2rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: none;
}

.message.error {
    background: #fde8e8;
    color: #a93226;
    border: 1px solid #f5c6c6;
    display: block;
}

.message.info {
    background: #e6f3f9;
    color: #1b4f6e;
    border: 1px solid #bddae6;
    display: block;
}

.message.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    display: block;
}

.spinner-overlay {
    display: none;
    justify-content: center;
    padding: 2rem 0 1.5rem;
}

.spinner-overlay.active {
    display: flex;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #1d6f8b;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results-container {
    margin-top: 1.5rem;
    display: none;
}

.results-container.visible {
    display: block;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-invoice-header {
    background: #eef3f8;
    border-radius: 1rem;
    padding: 1.2rem 1.8rem;
    margin-bottom: 1.2rem;
    border-left: 4px solid #1d6f8b;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.8rem 1.5rem;
}

.result-invoice-header .invoice-number {
    font-weight: 700;
    font-size: 1.4rem;
    color: #0f3b4f;
    background: #ffffff;
    padding: 0.2rem 1.2rem;
    border-radius: 40px;
    border: 2px solid #1d6f8b;
    color: #1d6f8b;
}

.result-invoice-header .invoice-date {
    font-size: 1.1rem;
    color: #0f3b4f;
    font-weight: 600;
}

.result-invoice-header .invoice-date strong {
    color: #1d6f8b;
    font-weight: 700;
}

.result-invoice-header .meta-info {
    margin-left: auto;
    font-size: 0.9rem;
    color: #475569;
}

.result-invoice-header .highlight-label {
    margin-left: 1rem;
    font-size: 0.9rem;
    background: #fff3cd;
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid #ffc107;
    color: #856404;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid #e2edf2;
    background: #fff;
}

table.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

table.result-table thead {
    background: #f8fafc;
}

table.result-table th {
    text-align: left;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    color: #0f3b4f;
    border-bottom: 1.5px solid #d4e2ec;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table.result-table td {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid #e2edf2;
    vertical-align: middle;
}

table.result-table tbody tr:last-child td {
    border-bottom: none;
}

table.result-table tbody tr:hover {
    background: #fafcff;
}

.highlight-invoice {
    font-weight: 700;
    color: #1d6f8b;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.8rem 0.2rem 0.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}
.status-badge.active .dot {
    background: #22c55e;
}

.status-badge.expiring {
    background: #fef9c3;
    color: #854d0e;
}
.status-badge.expiring .dot {
    background: #eab308;
}

.status-badge.expired {
    background: #fee2e2;
    color: #991b1b;
}
.status-badge.expired .dot {
    background: #ef4444;
}

.status-badge.unknown {
    background: #eef3f8;
    color: #475569;
}
.status-badge.unknown .dot {
    background: #94a3b8;
}

.detail-card {
    background: #f8fafc;
    border-radius: 1.5rem;
    border: 1px solid #e2edf2;
    padding: 1.8rem 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-card .card-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 1.5rem;
}

.detail-card .card-row .label {
    font-weight: 500;
    color: #5c7f8c;
    min-width: 120px;
    font-size: 0.95rem;
}

.detail-card .card-row .value {
    font-weight: 600;
    color: #0f3b4f;
    font-size: 1rem;
}

.detail-card .card-row .value.invoice-highlight {
    background: #ffffff;
    padding: 0.1rem 1rem;
    border-radius: 40px;
    border: 2px solid #1d6f8b;
    color: #1d6f8b;
    font-weight: 700;
    font-size: 1.05rem;
}

.detail-card .card-actions {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #1d6f8b;
    color: #1d6f8b;
    padding: 0.5rem 1.8rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.btn-outline:hover {
    background: #1d6f8b;
    color: #fff;
}

.footer-info {
    margin-top: 2rem;
    padding-top: 1.8rem;
    border-top: 2px solid #d4e2ec;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.footer-info .links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.8rem;
    align-items: center;
}

.footer-info .links .link {
    color: #1d6f8b;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.15s;
}

.footer-info .links .link:hover {
    color: #124c66;
    text-decoration: underline;
}

.footer-info .action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.btn-secondary {
    background: #eef3f8;
    color: #0f3b4f;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: default;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: #e2eaf2;
}

.btn-secondary.primary-outline {
    background: transparent;
    border: 1.5px solid #1d6f8b;
    color: #1d6f8b;
    cursor: pointer;
}

.btn-secondary.primary-outline:hover {
    background: #e6f3f9;
}

.history-placeholder {
    font-size: 0.9rem;
    color: #94a3b8;
    font-style: italic;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 76, 102, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal-box {
    background: #fff;
    border-radius: 2rem;
    max-width: 620px;
    width: 100%;
    padding: 2rem 2.5rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f3b4f;
    margin-bottom: 1rem;
}

.modal-box p,
.modal-box li {
    color: #1f3b48;
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-box ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem;
}

.modal-box ul li {
    margin-bottom: 0.4rem;
}

.modal-box .close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.15s;
}

.modal-box .close-modal:hover {
    color: #0f3b4f;
}

.modal-box .modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.modal-box .btn-close-modal {
    background: #eef3f8;
    border: none;
    padding: 0.5rem 2rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.modal-box .btn-close-modal:hover {
    background: #e2eaf2;
}

.terms-list {
    list-style: none;
    padding-left: 0;
    margin: 0.8rem 0 1.2rem;
}

.terms-list li {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.terms-list li .icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.terms-list li .text {
    font-size: 0.95rem;
}
.terms-list li .text strong {
    display: block;
    font-weight: 600;
}
.terms-list li .text .sub {
    font-size: 0.9rem;
    color: #5c7f8c;
    font-weight: 400;
}

/* Специфичные для капчи и подсветки строки */
.captcha-error-input {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2) !important;
}
.captcha-wrapper .captcha-error {
    color: #c0392b;
    font-weight: 600;
}
.highlight-row {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
    transition: background-color 0.3s ease;
}
.highlight-row td {
    background-color: #fff3cd !important;
}
.highlight-row:hover td {
    background-color: #ffe69b !important;
}

/* Адаптивность (медиа-запросы) */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.8rem;
    }
    .service-header {
        padding: 1.8rem 1.5rem 1.5rem;
    }
    .service-header h1 {
        font-size: 1.8rem;
    }
    .service-header p {
        font-size: 1rem;
    }
    .service-content {
        padding: 1.5rem 1.2rem 2rem;
    }
    .info-block {
        padding: 1.5rem 1.2rem;
    }
    .fields-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .search-actions {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
    }
    .search-actions .captcha-wrapper {
        justify-content: center;
        border-radius: 1rem;
        padding: 0.6rem 1rem;
        width: 100%;
    }
    .search-actions .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }
    .block-title-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
    .result-invoice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .result-invoice-header .meta-info {
        margin-left: 0;
    }
    .result-invoice-header .highlight-label {
        margin-left: 0;
    }
    .detail-card {
        padding: 1.2rem 1.2rem;
    }
    .footer-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .modal-box {
        padding: 1.5rem 1.2rem;
        max-width: 100%;
    }
    .modal-box h2 {
        font-size: 1.3rem;
    }
    .terms-list li {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .service-header h1 {
        font-size: 1.4rem;
    }
    .service-header .badge {
        font-size: 0.75rem;
        padding: 0.3rem 1rem;
    }
}