/* ================================================================
   Price calculator page block (Provēšanas pakalpojumu kalkulators)
   Form with metal switch + result panel, calculation steps and
   current tariffs. The sums are calculated on the server
   (onPriceCalc handler in partials/home/price-calc-form.htm).
   Section head reuses .pub-section / .pub-section__head
   from publications-block.css
   ================================================================ */

.pc-block * {
    box-sizing: border-box;
}

.pc-block [hidden] {
    display: none !important;
}

/* ================= layout ================= */

.pc-calc {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    scroll-margin-top: 90px;
}

/* ================= form ================= */

.pc-form {
    margin: 0;
    padding: 36px 40px 40px;
    border: 1px solid var(--pub-line);
    border-radius: 22px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-m);
}

.pc-group {
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.pc-group__label {
    display: block;
    margin: 0 0 12px;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

/* metal tiles */

.pc-metals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pc-metal {
    position: relative;
    display: block;
    cursor: pointer;
}

.pc-metal input,
.pc-kind input,
.pc-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.pc-metal__box {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 16px 18px;
    border: 1px solid var(--pub-line);
    border-radius: 16px;
    background-color: var(--pub-rose);
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.pc-metal__coin {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 4px 10px rgba(0, 0, 0, .12);
}

.pc-metal__coin--gold {
    background: linear-gradient(145deg, #e6c878 0%, #b88a2e 100%);
}

.pc-metal__coin--silver {
    background: linear-gradient(145deg, #dfe2e7 0%, #8f959e 100%);
}

.pc-metal__name {
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--pub-ink);
}

.pc-metal__check {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: auto;
    border: 1px solid #d8c3c9;
    border-radius: 50%;
    background-color: #fff;
    color: transparent;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.pc-metal__check svg {
    width: 13px;
    height: 13px;
}

.pc-metal:hover .pc-metal__box {
    border-color: #d8c3c9;
}

.pc-metal input:checked + .pc-metal__box {
    border-color: var(--pub-bordo);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(107, 12, 38, .08);
}

.pc-metal input:checked + .pc-metal__box .pc-metal__check {
    border-color: var(--pub-bordo);
    background-color: var(--pub-bordo);
    color: #fff;
}

.pc-metal input:focus-visible + .pc-metal__box,
.pc-kind input:focus-visible + span,
.pc-switch input:focus-visible + .pc-switch__track {
    outline: 2px solid var(--pub-red);
    outline-offset: 2px;
}

/* product kind segmented control */

.pc-kinds {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--pub-line);
    border-radius: 999px;
    background-color: var(--pub-rose);
}

.pc-kind {
    position: relative;
    cursor: pointer;
}

.pc-kind span {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pub-muted);
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.pc-kind:hover span {
    color: var(--pub-bordo);
}

.pc-kind input:checked + span {
    background-color: #fff;
    color: var(--pub-bordo);
    box-shadow: var(--pub-shadow-s);
}

/* number fields */

.pc-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 24px;
}

.pc-field__label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--pub-ink);
}

.pc-field__box {
    position: relative;
    display: block;
}

.pc-field__input {
    width: 100%;
    height: 54px;
    padding: 0 58px 0 18px;
    border: 1px solid var(--pub-line);
    border-radius: 14px;
    background-color: var(--pub-rose);
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--pub-ink);
    outline: none;
    -moz-appearance: textfield;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.pc-field__input::placeholder {
    font-weight: 400;
    color: #b9a7ac;
}

.pc-field__input:focus {
    border-color: var(--pub-bordo-soft);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(107, 12, 38, .08);
}

.pc-field__unit {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 500;
    color: var(--pub-bordo-soft);
    pointer-events: none;
}

.pc-field__hint {
    display: block;
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pub-muted);
}

/* urgent switch */

.pc-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 30px;
    padding: 16px 18px;
    border: 1px solid var(--pub-line);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.pc-switch:hover {
    border-color: #d8c3c9;
}

.pc-switch__track {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background-color: #e3d6da;
    transition: background-color .2s ease;
}

.pc-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
    transition: transform .2s ease;
}

.pc-switch input:checked + .pc-switch__track {
    background-color: var(--pub-bordo);
}

.pc-switch input:checked + .pc-switch__track::after {
    transform: translateX(20px);
}

.pc-switch__title {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--pub-ink);
}

.pc-switch__hint {
    display: block;
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pub-muted);
}

/* buttons */

.pc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 28px;
    border: 1px solid var(--pub-bordo);
    border-radius: 999px;
    background-color: var(--pub-bordo);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease, color .2s ease;
}

.pc-btn svg {
    width: 18px;
    height: 18px;
}

.pc-btn:hover {
    background-color: var(--pub-red);
    box-shadow: 0 10px 22px rgba(107, 12, 38, .22);
    transform: translateY(-1px);
}

.pc-btn--ghost {
    border-color: var(--pub-line);
    background-color: transparent;
    color: var(--pub-muted);
}

.pc-btn--ghost:hover {
    border-color: var(--pub-bordo-soft);
    background-color: transparent;
    color: var(--pub-bordo);
    box-shadow: none;
}

/* ================= result panel ================= */

.pc-result {
    position: sticky;
    top: 90px;
    overflow: hidden;
    padding: 32px 32px 28px;
    border-radius: 22px;
    background: linear-gradient(155deg, var(--pub-red) 0%, var(--pub-bordo) 100%);
    color: #fff;
    box-shadow: var(--pub-shadow-m);
}

.pc-result::after {
    content: '';
    position: absolute;
    top: -90px;
    right: -90px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    pointer-events: none;
}

.pc-result__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0 0 22px;
}

.pc-result__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.pc-result__metal {
    padding: 6px 12px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .14);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .04em;
}

.pc-sum {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.pc-sum__label {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .8);
}

.pc-sum__amount {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    transition: opacity .2s ease;
}

.pc-sum__value {
    font-weight: 700;
}

.pc-sum--second .pc-sum__amount {
    font-size: 32px;
}

.pc-sum__currency {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, .78);
}

.pc-sum__vat {
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}

.pc-result.is-empty .pc-sum__amount {
    opacity: .45;
}

.pc-result.is-loading .pc-sum__amount {
    opacity: .55;
}

.pc-result__state {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, .1);
    font-size: 14px;
    line-height: 1.5;
}

.pc-result__state svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.pc-result__note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
}

.pc-result__note svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.pc-result__note + .pc-result__note {
    border-top: 0;
    padding-top: 10px;
}

.pc-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pc-spin .7s linear infinite;
}

.pc-result.is-loading .pc-spinner {
    display: inline-block;
}

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

/* ================= steps + tariffs ================= */

.pc-info {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    margin: 64px 0 0;
    scroll-margin-top: 90px;
}

.pc-info__title {
    margin: 0 0 24px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pub-bordo);
}

.pc-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: pc-step;
}

.pc-step {
    position: relative;
    padding: 24px 24px 22px;
    border: 1px solid var(--pub-line);
    border-radius: 18px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-s);
    counter-increment: pc-step;
}

.pc-step::before {
    content: counter(pc-step, decimal-leading-zero);
    display: block;
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--pub-red);
}

.pc-step__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--pub-bordo);
}

.pc-step__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pub-muted);
}

.pc-tariffs {
    padding: 28px 28px 20px;
    border: 1px solid var(--pub-line);
    border-radius: 20px;
    background-color: var(--pub-rose);
}

.pc-tariffs__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
}

.pc-tariffs__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--pub-bordo);
}

.pc-tariffs__note {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.pc-tariffs__group {
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pub-ink);
}

.pc-tariffs__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pc-tariffs__list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed #e0cfd4;
    font-size: 14px;
    color: var(--pub-muted);
}

.pc-tariffs__list li:last-child {
    border-bottom: 0;
}

.pc-tariffs__list b {
    flex: 0 0 auto;
    font-weight: 500;
    color: var(--pub-bordo);
    white-space: nowrap;
}

.pc-tariffs.is-silver .pc-tariffs__gold,
.pc-tariffs.is-gold .pc-tariffs__silver {
    opacity: .5;
}

/* ================= responsive ================= */

@media (max-width: 1200px) {
    .pc-form {
        padding: 32px 30px 34px;
    }

    .pc-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pc-sum__amount {
        font-size: 38px;
    }
}

@media (max-width: 1024px) {
    .pc-calc,
    .pc-info {
        grid-template-columns: minmax(0, 1fr);
    }

    .pc-result {
        position: relative;
        top: auto;
    }

    .pc-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pc-info {
        margin-top: 48px;
    }
}

@media (max-width: 768px) {
    .pc-form {
        padding: 26px 22px 28px;
        border-radius: 18px;
    }

    .pc-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .pc-result {
        padding: 26px 22px 22px;
        border-radius: 18px;
    }

    .pc-info__title {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .pc-metals {
        grid-template-columns: minmax(0, 1fr);
    }

    .pc-kinds {
        display: flex;
        border-radius: 16px;
    }

    .pc-kind {
        flex: 1 1 auto;
    }

    .pc-kind span {
        justify-content: center;
        width: 100%;
        border-radius: 12px;
    }

    .pc-actions .pc-btn {
        flex: 1 1 auto;
    }

    .pc-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .pc-sum__amount {
        font-size: 36px;
    }

    .pc-sum--second .pc-sum__amount {
        font-size: 28px;
    }

    .pc-tariffs {
        padding: 22px 20px 14px;
    }
}