/* ─── Base ─── */
html { scroll-behavior: smooth; }

/* Scale up ~20% on large screens to fill white space */
@media (min-width: 1280px) {
    html { font-size: 19px; }
}
@media (min-width: 1600px) {
    html { font-size: 20px; }
}

/* inter-regular - cyrillic_latin */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/inter-v20-cyrillic_latin-regular.e89d1ff37eea.woff2") format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-500 - cyrillic_latin */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    src: url("../fonts/inter-v20-cyrillic_latin-500.8f39c11f9da8.woff2") format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-600 - cyrillic_latin */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    src: url("../fonts/inter-v20-cyrillic_latin-600.3be0c0df260d.woff2") format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-700 - cyrillic_latin */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/inter-v20-cyrillic_latin-700.ba58c453d387.woff2") format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-800 - cyrillic_latin */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    src: url("../fonts/inter-v20-cyrillic_latin-800.5e64281569ca.woff2") format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-900 - cyrillic_latin */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Inter';
    font-style: normal;
    font-weight: 900;
    src: url("../fonts/inter-v20-cyrillic_latin-900.01cff0f15c9a.woff2") format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


/* ─── Header shadow on scroll ─── */
#header.scrolled {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active .modal-backdrop {
    opacity: 1;
}

.modal-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 30rem;
}

.modal-container--results {
    max-width: min(30rem, calc(100vw - 1.5rem));
}

.modal-card {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-card--results {
    max-height: calc(100dvh - 1.75rem);
    overflow-y: auto;
    display: block;
    border-radius: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.35;
    background:
        radial-gradient(circle at top right, rgba(185, 210, 90, 0.12), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #fcfcf8 100%);
}

.modal-card--results::-webkit-scrollbar {
    display: none;
}

.modal-card::-webkit-scrollbar {
    display: none;
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ─── Report confirmation: company type select ─── */
.confirm-company-type-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-left: 1rem;
    padding-right: 2.625rem;
    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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.1rem 1.1rem;
}

.confirm-company-type-select::-ms-expand {
    display: none;
}

/* ─── Report confirmation: add ОКВЭД + pills ─── */
.confirm-okved-add-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.confirm-okved-add-input {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.confirm-okved-add-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    padding: 0;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.confirm-okved-add-btn:hover {
    background: rgba(185, 210, 90, 0.2);
    border-color: rgba(185, 210, 90, 0.55);
    color: #3f6212;
}

.confirm-okved-add-btn:active {
    transform: scale(0.96);
}

.confirm-okved-add-btn__icon {
    display: block;
}

.confirm-okved-chips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.confirm-okved-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem 0.35rem 0.65rem;
    border-radius: 9999px;
    background: rgba(185, 210, 90, 0.14);
    border: 1px solid rgba(185, 210, 90, 0.45);
    font-size: 0.8125rem;
}

.confirm-okved-chip__code {
    font-weight: 600;
    color: #374151;
}

.confirm-okved-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #6b7280;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.confirm-okved-chip-remove:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #b45309;
}

/* ─── Modal step icons ─── */
.step-icon-ring {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-icon-ring.active {
    border-color: #b9d25a;
}

.step-icon-ring.done {
    border-color: #b9d25a;
    background: rgba(185, 210, 90, 0.14);
    color: #b9d25a;
}

/* ─── Spinner ─── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid #e8f0c8;
    border-top-color: #b9d25a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ─── Progress bar pulse ─── */
@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-bar-animated {
    animation: progress-pulse 1.5s ease-in-out infinite;
}

/* ─── Fade-in for modal content transitions ─── */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-slide-up {
    animation: fadeSlideUp 0.4s ease forwards;
}

/* ─── Result metric cards ─── */
.metric-card {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    transition: border-color 0.2s;
}

.metric-card:hover {
    border-color: #e8f0c8;
}

/* ─── Results preview modal ─── */
.rp-shell {
    position: relative;
    display: block;
    padding: clamp(0.82rem, 1.9vw, 1.08rem);
}

.rp-header {
    padding-right: 2.75rem;
    margin-bottom: 1rem;
}

.rp-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.rp-done-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.65rem 0.32rem 0.55rem;
    border-radius: 9999px;
    background: rgba(185, 210, 90, 0.16);
    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.rp-done-badge .rp-badge-check {
    color: #b9d25a;
}

.rp-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.65rem;
    border-radius: 9999px;
    background: rgba(17, 24, 39, 0.04);
    color: #374151;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.rp-badge-check {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.rp-page-title {
    margin: 0.62rem 0 0.22rem;
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
    line-height: 1.15;
}

.rp-page-sub {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.35;
}

.rp-cards {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.62rem;
    align-content: start;
    margin-bottom: 1rem;
}

.rp-card {
    grid-column: span 12;
    border-radius: 1rem;
    padding: 0.76rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 16px 40px -28px rgba(17, 24, 39, 0.28);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
}

.rp-card--loss {
    background: linear-gradient(180deg, #fff7f7 0%, #fff1f1 100%);
    border-color: #f1d0d0;
}

.rp-card--gain {
    background: linear-gradient(180deg, #f4fcf7 0%, #edf8f1 100%);
    border-color: #cfe8d8;
}

.rp-card--warn {
    background: linear-gradient(180deg, #fffaf2 0%, #fff5e7 100%);
    border-color: #f4dec0;
}

.rp-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.58rem;
}

.rp-card__head-text {
    min-width: 0;
}

.rp-card__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.rp-card__title--loss {
    color: #d32f2f;
}

.rp-card__title--gain {
    color: #2e7d32;
}

.rp-card__title--warn {
    color: #ed6c02;
}

.rp-card__sub {
    margin: 0.18rem 0 0;
    font-size: 0.74rem;
    line-height: 1.3;
    color: #6b7280;
}

.rp-icon-ring {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rp-icon-ring--loss {
    background: #fce4e4;
    color: #d32f2f;
}

.rp-icon-ring--gain {
    background: #d9f0e4;
    color: #2e7d32;
}

.rp-icon-ring--warn {
    background: #ffedd5;
    color: #ed6c02;
}

.rp-ring-ico {
    width: 1.05rem;
    height: 1.05rem;
}

.rp-loss-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.rp-loss-mini {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(211, 47, 47, 0.14);
    border-radius: 0.75rem;
    padding: 0.45rem 0.45rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.15rem;
}

.rp-loss-mini__top {
    display: flex;
    align-items: center;
    gap: 0.28rem;
}

.rp-stat-ico {
    width: 0.9rem;
    height: 0.9rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.rp-loss-mini__lbl {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
}

.rp-loss-mini__val {
    font-size: clamp(0.72rem, 1.35vw, 0.88rem);
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.rp-card__row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.rp-card__main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.rp-card__aside {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    width: 7.15rem;
    min-width: 7.15rem;
    padding: 0.45rem 0.45rem;
    border-radius: 0.75rem;
}

.rp-card__aside--gain {
    background: rgba(46, 125, 50, 0.14);
}

.rp-card__aside--warn {
    background: rgba(237, 108, 2, 0.12);
}

.rp-aside-lbl {
    font-size: 0.65rem;
    font-weight: 600;
    color: #4b5563;
    line-height: 1.2;
}

.rp-aside-val {
    margin-top: 0.12rem;
    font-size: clamp(0.72rem, 1.35vw, 0.88rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.rp-aside-val--gain {
    color: #2e7d32;
}

.rp-aside-val--warn {
    color: #ed6c02;
}

.rp-foot {
    position: relative;
    z-index: 1;
}

.rp-foot__rule {
    height: 1px;
    background: rgba(17, 24, 39, 0.08);
    margin-bottom: 0.65rem;
}

.rp-foot__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.8rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 16px 36px -28px rgba(17, 24, 39, 0.24);
}

.rp-foot__copy {
    flex: none;
}

.rp-foot__actions {
    flex: none;
    width: 100%;
}

.rp-foot__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #97c14a;
}

.rp-foot__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.rp-foot__hint {
    margin: 0.34rem 0 0;
    font-size: 0.76rem;
    line-height: 1.35;
    color: #6b7280;
}

.rp-email-wrap, .rp-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    background: #fff;
    padding: 0 0.4rem 0 0.8rem;
    margin-bottom: 0.65rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rp-email-wrap:focus-within, .rp-name-wrap:focus-within {
    border-color: #97c14a;
    box-shadow: 0 0 0 2px rgba(151, 193, 74, 0.2);
}

.rp-input-ico {
    width: 1.1rem;
    height: 1.1rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.rp-email-input, .rp-name-input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0.72rem 0.5rem 0.72rem 0.15rem;
    font-size: 0.84rem;
    outline: none;
    background: transparent;
    color: #111827;
}

.rp-email-input::placeholder, .rp-name-input::placeholder {
    color: #9ca3af;
}

.rp-pdf-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.82rem 0.9rem;
    border: 0;
    border-radius: 0.85rem;
    background: #97c14a;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.rp-pdf-btn:hover {
    background: #89b03f;
}

.rp-pdf-btn:active {
    transform: scale(0.99);
}

.rp-pdf-btn:disabled {
    background: #d1d5db;
    color: #f9fafb;
    cursor: not-allowed;
    transform: none;
}

.rp-pdf-btn:disabled:hover {
    background: #d1d5db;
}

.rp-send-success {
    text-align: center;
    padding: 0.5rem 0.25rem 0.15rem;
}

.rp-send-success__icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.65rem;
    border-radius: 9999px;
    background: rgba(151, 193, 74, 0.15);
    color: #6b8e23;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-send-success__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.rp-send-success__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.rp-send-success__text {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #6b7280;
}

.rp-btn-ico {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.modal-card--results .modal-close-btn {
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 10px 24px -22px rgba(17, 24, 39, 0.5);
}

@media (max-width: 899px) {
    .rp-card__aside {
        width: 7.15rem;
        min-width: 7.15rem;
    }
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-container--results {
        max-width: 100%;
    }

    .modal-card--results {
        max-height: calc(100dvh - 1.75rem);
        border-radius: 1.15rem;
    }

    .rp-shell {
        gap: 0.66rem;
        padding: 0.9rem;
    }

    .rp-page-title {
        font-size: 1.15rem;
    }

    .rp-card,
    .rp-foot__card {
        padding: 0.78rem;
    }

    .rp-email-input {
        font-size: 0.82rem;
    }
}

@media (max-height: 700px) {
    .modal-card--results {
        max-height: calc(100dvh - 1.75rem);
    }

    .rp-shell {
        gap: 0.64rem;
    }
}

/* ─── Blurred locked section ─── */
.locked-section {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: linear-gradient(135deg, #fefce8, #f5f8e8);
}

.locked-section .blur-content {
    filter: blur(4px);
    user-select: none;
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #6b7280;
}

.locked-section .lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

/* ─── INN input error state ─── */
.inn-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* ─── Scroll-reveal animation ─── */
@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
}

.reveal.visible {
    animation: revealUp 0.6s ease forwards;
}

/* Stagger children */
.reveal.visible:nth-child(2) { animation-delay: 0.1s; }
.reveal.visible:nth-child(3) { animation-delay: 0.2s; }
.reveal.visible:nth-child(4) { animation-delay: 0.3s; }

/* ─── Mobile menu transition ─── */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.open {
    max-height: 300px;
    display: block;
}

/* ─── Step number hover ─── */
.step-number {
    transition: color 0.3s ease;
}

.step-card:hover .step-number {
    color: #d4e4a0;
}

/* ─── Button loading state ─── */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}
