/*
|--------------------------------------------------------------------------
| ToolVerse - Percentage Calculator
|--------------------------------------------------------------------------
| Scope:
| - Percentage Calculator page only
| - Fully responsive
| - No global CSS leakage
|--------------------------------------------------------------------------
*/

.tv-percentage-page {
    width: 100%;
    color: var(--tv-color-text);
    background: #ffffff;
}


/* ==========================================================================
   HERO
   ========================================================================== */

.tv-percentage-hero {
    position: relative;
    overflow: hidden;
    padding: 44px 0 58px;

    background:
        radial-gradient(
            circle at 12% 8%,
            rgba(99, 91, 255, 0.08),
            transparent 32%
        ),
        linear-gradient(
            180deg,
            #fbfcff 0%,
            #f7f9fc 100%
        );
}


/* ==========================================================================
   BREADCRUMB
   ========================================================================== */

.tv-percentage-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 26px;

    color: #7b8798;

    font-size: 10px;
    font-weight: 650;
    line-height: 1.4;
}

.tv-percentage-breadcrumb a {
    color: var(--tv-color-primary);
    transition: color 160ms ease;
}

.tv-percentage-breadcrumb a:hover {
    color: var(--tv-color-primary-dark);
}

.tv-percentage-breadcrumb span[aria-current="page"] {
    color: #596579;
}


/* ==========================================================================
   HERO LAYOUT
   ========================================================================== */

.tv-percentage-hero__layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(320px, 0.55fr);

    align-items: center;

    gap: 48px;
}


/* ==========================================================================
   LABELS
   ========================================================================== */

.tv-percentage-eyebrow,
.tv-percentage-section-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 29px;

    padding: 0 10px;

    border: 1px solid rgba(99, 91, 255, 0.13);
    border-radius: 999px;

    background: var(--tv-color-primary-soft);

    color: var(--tv-color-primary-dark);

    font-size: 9px;
    font-weight: 760;
    line-height: 1;

    letter-spacing: 0.2px;
}


/* ==========================================================================
   HERO CONTENT
   ========================================================================== */

.tv-percentage-hero__content h1 {
    max-width: 760px;

    margin: 14px 0 0;

    color: var(--tv-color-heading);

    font-size: clamp(36px, 4.4vw, 56px);
    font-weight: 830;

    line-height: 1.04;
    letter-spacing: -1.9px;
}

.tv-percentage-hero__content > p {
    max-width: 690px;

    margin: 18px 0 0;

    color: var(--tv-color-muted);

    font-size: 15px;
    line-height: 1.75;
}


/* ==========================================================================
   HERO POINTS
   ========================================================================== */

.tv-percentage-hero__points {
    display: flex;
    flex-wrap: wrap;

    gap: 10px 14px;

    margin-top: 22px;
}

.tv-percentage-hero__points span {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    color: #536173;

    font-size: 10px;
    font-weight: 650;
}

.tv-percentage-hero__points svg {
    width: 17px;
    height: 17px;

    padding: 3px;

    border-radius: 50%;

    background: var(--tv-color-accent-soft);

    fill: none;

    stroke: var(--tv-color-success);

    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================================
   HERO NOTE
   ========================================================================== */

.tv-percentage-hero__note {
    padding: 22px;

    border: 1px solid rgba(99, 91, 255, 0.12);
    border-radius: 20px;

    background: rgba(255, 255, 255, 0.88);

    box-shadow:
        0 14px 34px
        rgba(16, 24, 40, 0.055);
}

.tv-percentage-hero__note-label {
    color: var(--tv-color-primary);

    font-size: 9px;
    font-weight: 760;

    text-transform: uppercase;
    letter-spacing: 0.55px;
}

.tv-percentage-hero__note strong {
    display: block;

    margin-top: 8px;

    color: var(--tv-color-heading);

    font-size: 15px;
    font-weight: 780;

    line-height: 1.45;
}

.tv-percentage-hero__note p {
    margin: 7px 0 0;

    color: var(--tv-color-muted);

    font-size: 10px;
    line-height: 1.65;
}


/* ==========================================================================
   CALCULATOR SECTION
   ========================================================================== */

.tv-percentage-calculator-section {
    padding: 64px 0 74px;
    background: #ffffff;
}


/* ==========================================================================
   CALCULATOR
   ========================================================================== */

.tv-percentage-calculator {
    display: grid;

    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(360px, 0.9fr);

    overflow: hidden;

    border: 1px solid rgba(220, 225, 234, 0.96);
    border-radius: 24px;

    background: #ffffff;

    box-shadow:
        0 24px 60px
        rgba(16, 24, 40, 0.075);
}


/* ==========================================================================
   FORM
   ========================================================================== */

.tv-percentage-calculator__form {
    padding: 34px;
}

.tv-percentage-calculator__heading > span {
    color: var(--tv-color-primary);

    font-size: 9px;
    font-weight: 760;

    text-transform: uppercase;
    letter-spacing: 0.55px;
}

.tv-percentage-calculator__heading h2 {
    margin: 7px 0 0;

    color: var(--tv-color-heading);

    font-size: 26px;
    font-weight: 800;

    line-height: 1.2;
    letter-spacing: -0.8px;
}

.tv-percentage-calculator__heading p {
    margin: 7px 0 0;

    color: var(--tv-color-muted);

    font-size: 11px;
    line-height: 1.6;
}


/* ==========================================================================
   CALCULATION MODE
   ========================================================================== */

.tv-percentage-mode {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 5px;

    margin-top: 25px;
    padding: 4px;

    border: 1px solid var(--tv-color-border);
    border-radius: 14px;

    background: #f6f7f9;
}

.tv-percentage-mode button {
    min-height: 43px;

    padding: 7px 10px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    color: #667085;

    font-size: 9px;
    font-weight: 720;
    line-height: 1.3;

    cursor: pointer;

    transition:
        color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.tv-percentage-mode button:hover {
    color: var(--tv-color-heading);
}

.tv-percentage-mode button.is-active {
    background: #ffffff;

    color: var(--tv-color-primary-dark);

    box-shadow:
        0 3px 10px
        rgba(16, 24, 40, 0.07);
}


/* ==========================================================================
   PANELS
   ========================================================================== */

.tv-percentage-panel {
    margin-top: 30px;
}

.tv-percentage-panel[hidden] {
    display: none;
}


/* ==========================================================================
   CALCULATION SENTENCE
   ========================================================================== */

.tv-percentage-sentence {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    align-items: end;

    gap: 14px;
}

.tv-percentage-sentence__text {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    color: #7b8798;

    font-size: 10px;
    font-weight: 700;

    white-space: nowrap;
}


/* ==========================================================================
   FIELD
   ========================================================================== */

.tv-percentage-field label {
    display: block;

    margin-bottom: 8px;

    color: var(--tv-color-heading);

    font-size: 10px;
    font-weight: 720;
}

.tv-percentage-field__input-wrap {
    display: flex;
    align-items: center;

    min-height: 48px;

    padding: 0 13px;

    border: 1px solid var(--tv-color-border);
    border-radius: 13px;

    background: #fafbfc;

    color: #667085;

    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.tv-percentage-field__input-wrap:focus-within {
    border-color: rgba(99, 91, 255, 0.45);

    background: #ffffff;

    box-shadow:
        0 0 0 3px
        rgba(99, 91, 255, 0.07);
}

.tv-percentage-field__input-wrap input {
    width: 100%;
    min-width: 0;
    height: 46px;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--tv-color-heading);

    font-size: 14px;
    font-weight: 760;
}

.tv-percentage-field__input-wrap > span {
    margin-left: 7px;

    color: #667085;

    font-size: 11px;
    font-weight: 720;
}


/* ==========================================================================
   REMOVE NUMBER SPINNERS
   ========================================================================== */

.tv-percentage-field input[type="number"]::-webkit-outer-spin-button,
.tv-percentage-field input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.tv-percentage-field input[type="number"] {
    -moz-appearance: textfield;
}


/* ==========================================================================
   ERROR
   ========================================================================== */

.tv-percentage-error {
    margin-top: 18px;

    padding: 11px 13px;

    border: 1px solid rgba(217, 45, 32, 0.14);
    border-radius: 11px;

    background: #fff6f5;

    color: var(--tv-color-danger);

    font-size: 9px;
    font-weight: 650;

    line-height: 1.5;
}

.tv-percentage-error[hidden] {
    display: none;
}


/* ==========================================================================
   RESULTS
   ========================================================================== */

.tv-percentage-results {
    display: flex;
    flex-direction: column;

    min-width: 0;

    padding: 34px;

    background:
        linear-gradient(
            150deg,
            #111827 0%,
            #171d2d 58%,
            #242047 100%
        );

    color: #ffffff;
}


/* ==========================================================================
   MAIN RESULT
   ========================================================================== */

.tv-percentage-results__top {
    padding-bottom: 25px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.09);
}

.tv-percentage-results__top > span {
    display: block;

    color: #aeb8c7;

    font-size: 10px;
    font-weight: 650;

    line-height: 1.5;
}

.tv-percentage-results__top > strong {
    display: block;

    margin-top: 8px;

    overflow-wrap: anywhere;

    color: #ffffff;

    font-size: clamp(38px, 4.6vw, 54px);
    font-weight: 830;

    line-height: 1;

    letter-spacing: -1.8px;
}

.tv-percentage-results__top > small {
    display: block;

    margin-top: 8px;

    color: #78869a;

    font-size: 8px;
    font-weight: 600;
}


/* ==========================================================================
   RESULT SUMMARY
   ========================================================================== */

.tv-percentage-results__summary {
    margin-top: 22px;
}

.tv-percentage-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-height: 47px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.07);
}

.tv-percentage-result-row span {
    flex: 0 0 auto;

    color: #9ca8b8;

    font-size: 9px;
    font-weight: 600;
}

.tv-percentage-result-row strong {
    min-width: 0;

    color: #ffffff;

    font-size: 10px;
    font-weight: 740;

    text-align: right;

    overflow-wrap: anywhere;
}

.tv-percentage-result-row--total {
    border-bottom: 0;
}

.tv-percentage-result-row--total strong {
    font-size: 12px;
}


/* ==========================================================================
   EXPLANATION CARD
   ========================================================================== */

.tv-percentage-result-card {
    margin-top: 24px;

    padding: 16px;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.045);
}

.tv-percentage-result-card strong {
    display: block;

    color: #ffffff;

    font-size: 9px;
    font-weight: 760;
}

.tv-percentage-result-card p {
    margin: 5px 0 0;

    color: #9ca8b8;

    font-size: 9px;
    line-height: 1.65;
}


/* ==========================================================================
   RESET
   ========================================================================== */

.tv-percentage-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;
    min-height: 38px;

    margin-top: 18px;

    padding: 0 13px;

    border:
        1px solid
        rgba(255, 255, 255, 0.11);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.055);

    color: #c1cad7;

    font-size: 9px;
    font-weight: 700;

    cursor: pointer;

    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease;
}

.tv-percentage-reset:hover {
    border-color:
        rgba(255, 255, 255, 0.19);

    background:
        rgba(255, 255, 255, 0.09);

    color: #ffffff;
}


/* ==========================================================================
   CONTENT
   ========================================================================== */

.tv-percentage-content {
    padding: 74px 0;

    background: #f8fafc;
}

.tv-percentage-content__layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(280px, 0.38fr);

    align-items: start;

    gap: 48px;
}


/* ==========================================================================
   ARTICLE
   ========================================================================== */

.tv-percentage-article {
    max-width: 780px;
}

.tv-percentage-article h2 {
    margin: 36px 0 0;

    color: var(--tv-color-heading);

    font-size: 24px;
    font-weight: 800;

    line-height: 1.25;
    letter-spacing: -0.65px;
}

.tv-percentage-article .tv-percentage-section-label + h2 {
    margin-top: 11px;
}

.tv-percentage-article p {
    margin: 11px 0 0;

    color: var(--tv-color-muted);

    font-size: 12px;
    line-height: 1.8;
}


/* ==========================================================================
   FORMULA
   ========================================================================== */

.tv-percentage-formula {
    margin-top: 18px;

    padding: 18px 20px;

    border: 1px solid rgba(99, 91, 255, 0.12);
    border-radius: 15px;

    background: #ffffff;
}

.tv-percentage-formula strong {
    display: block;

    color: var(--tv-color-heading);

    font-size: 13px;
    font-weight: 780;

    line-height: 1.6;
}

.tv-percentage-formula span {
    display: block;

    margin-top: 6px;

    color: var(--tv-color-muted);

    font-size: 9px;
    line-height: 1.6;
}


/* ==========================================================================
   EXAMPLES
   ========================================================================== */

.tv-percentage-example-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 11px;

    margin-top: 27px;
}

.tv-percentage-example-grid > div {
    padding: 16px;

    border: 1px solid var(--tv-color-border);
    border-radius: 14px;

    background: #ffffff;
}

.tv-percentage-example-grid strong {
    color: var(--tv-color-heading);

    font-size: 10px;
    font-weight: 760;
}

.tv-percentage-example-grid p {
    margin-top: 5px;

    font-size: 9px;
    line-height: 1.65;
}


/* ==========================================================================
   RELATED TOOLS
   ========================================================================== */

.tv-percentage-related {
    position: sticky;

    top:
        calc(
            var(--tv-header-height)
            + 24px
        );
}

.tv-percentage-related h2 {
    margin: 11px 0 0;

    color: var(--tv-color-heading);

    font-size: 20px;
    font-weight: 790;

    line-height: 1.3;
    letter-spacing: -0.45px;
}

.tv-percentage-related__list {
    display: grid;

    gap: 9px;

    margin-top: 17px;
}

.tv-percentage-related__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    min-height: 68px;

    padding: 12px 13px;

    border: 1px solid var(--tv-color-border);
    border-radius: 14px;

    background: #ffffff;

    transition:
        border-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.tv-percentage-related__list a:hover {
    border-color:
        rgba(99, 91, 255, 0.18);

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px
        rgba(16, 24, 40, 0.055);
}

.tv-percentage-related__list span {
    min-width: 0;

    color: var(--tv-color-heading);

    font-size: 10px;
    font-weight: 740;
}

.tv-percentage-related__list small {
    display: block;

    margin-top: 3px;

    color: var(--tv-color-muted);

    font-size: 8px;
    font-weight: 400;
}

.tv-percentage-related__list b {
    color: var(--tv-color-primary);

    font-size: 14px;
}


/* ==========================================================================
   FAQ
   ========================================================================== */

.tv-percentage-faq {
    padding: 74px 0 82px;

    background: #ffffff;
}

.tv-percentage-faq__head {
    max-width: 680px;

    margin-bottom: 25px;
}

.tv-percentage-faq__head h2 {
    margin: 11px 0 0;

    color: var(--tv-color-heading);

    font-size: clamp(27px, 3vw, 38px);
    font-weight: 810;

    line-height: 1.15;
    letter-spacing: -1.1px;
}

.tv-percentage-faq__head p {
    margin: 10px 0 0;

    color: var(--tv-color-muted);

    font-size: 11px;
    line-height: 1.65;
}

.tv-percentage-faq__list {
    display: grid;

    gap: 9px;

    max-width: 900px;
}

.tv-percentage-faq__item {
    overflow: hidden;

    border: 1px solid var(--tv-color-border);
    border-radius: 15px;

    background: #ffffff;
}

.tv-percentage-faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    min-height: 62px;

    padding: 14px 16px;

    color: var(--tv-color-heading);

    font-size: 11px;
    font-weight: 740;
    line-height: 1.45;

    cursor: pointer;
    list-style: none;
}

.tv-percentage-faq__item summary::-webkit-details-marker {
    display: none;
}

.tv-percentage-faq__item summary i {
    position: relative;

    width: 27px;
    height: 27px;

    flex: 0 0 27px;

    border: 1px solid var(--tv-color-border);
    border-radius: 9px;

    background: #fafbfc;
}

.tv-percentage-faq__item summary i::before,
.tv-percentage-faq__item summary i::after {
    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 10px;
    height: 2px;

    border-radius: 999px;

    background: #667085;

    transform: translate(-50%, -50%);

    transition: transform 160ms ease;
}

.tv-percentage-faq__item summary i::after {
    transform:
        translate(-50%, -50%)
        rotate(90deg);
}

.tv-percentage-faq__item[open] summary i::after {
    transform: translate(-50%, -50%);
}

.tv-percentage-faq__item > div {
    padding: 0 16px 15px;
}

.tv-percentage-faq__item > div p {
    max-width: 800px;

    margin: 0;

    color: var(--tv-color-muted);

    font-size: 10px;
    line-height: 1.7;
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1024px) {

    .tv-percentage-hero__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .tv-percentage-hero__note {
        max-width: 620px;
    }

    .tv-percentage-calculator {
        grid-template-columns: 1fr;
    }

    .tv-percentage-content__layout {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .tv-percentage-related {
        position: static;
        max-width: 620px;
    }
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 700px) {

    .tv-percentage-hero {
        padding: 34px 0 45px;
    }

    .tv-percentage-breadcrumb {
        margin-bottom: 20px;
    }

    .tv-percentage-hero__content h1 {
        font-size: clamp(32px, 10vw, 42px);
        letter-spacing: -1.35px;
    }

    .tv-percentage-hero__content > p {
        margin-top: 14px;

        font-size: 13px;
        line-height: 1.68;
    }

    .tv-percentage-calculator-section {
        padding: 48px 0 56px;
    }

    .tv-percentage-calculator {
        border-radius: 19px;
    }

    .tv-percentage-calculator__form,
    .tv-percentage-results {
        padding: 22px;
    }

    .tv-percentage-calculator__heading h2 {
        font-size: 22px;
    }

    .tv-percentage-mode {
        grid-template-columns: 1fr;
    }

    .tv-percentage-mode button {
        min-height: 39px;
    }

    .tv-percentage-sentence {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tv-percentage-sentence__text {
        justify-content: flex-start;

        min-height: auto;

        padding-left: 2px;
    }

    .tv-percentage-results__top > strong {
        font-size: clamp(36px, 12vw, 48px);
    }

    .tv-percentage-content {
        padding: 56px 0;
    }

    .tv-percentage-article h2 {
        margin-top: 29px;
        font-size: 21px;
    }

    .tv-percentage-article p {
        font-size: 11px;
    }

    .tv-percentage-example-grid {
        grid-template-columns: 1fr;
    }

    .tv-percentage-faq {
        padding: 56px 0 62px;
    }
}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 420px) {

    .tv-percentage-calculator__form,
    .tv-percentage-results {
        padding: 18px;
    }

    .tv-percentage-result-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;

        padding: 10px 0;
    }

    .tv-percentage-result-row strong {
        text-align: left;
    }

    .tv-percentage-formula {
        padding: 15px;
    }

    .tv-percentage-faq__item summary {
        gap: 13px;

        padding: 13px 14px;
    }

    .tv-percentage-faq__item > div {
        padding: 0 14px 14px;
    }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .tv-percentage-breadcrumb a,
    .tv-percentage-mode button,
    .tv-percentage-field__input-wrap,
    .tv-percentage-reset,
    .tv-percentage-related__list a,
    .tv-percentage-faq__item summary i::before,
    .tv-percentage-faq__item summary i::after {
        transition: none;
    }

    .tv-percentage-related__list a:hover {
        transform: none;
    }
}