/* ==========================================================================
   Hozina Technologies — Cost & Time-saving Calculator (Refined 2.0 Design)
   Pixel-perfect match to the latest approved layout.
   ========================================================================== */

body.page-calculator {
    overflow-x: hidden;
}

.calc-pro-page {
    background: #f4f8fc;
    min-height: 100vh;
    padding-bottom: 70px;
    color: #1e293b;
    font-family: var(--font-body);
    overflow-x: clip;
}

.calc-pro-page h1,
.calc-pro-page h2,
.calc-pro-page h3,
.calc-pro-page h4,
.calc-pro-page h5,
.calc-pro-page h6,
.calc-hero-h1,
.calc-panel-title-wrap h2,
.calc-card-title,
.calc-summary-title {
    font-family: var(--font-heading) !important;
}

.calc-pro-page button,
.calc-pro-page input,
.calc-pro-page select,
.calc-pro-page textarea {
    font-family: var(--font-body);
}

.calc-pro-container {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 24px;
    box-sizing: border-box;
}

/* ==========================================
   BREADCRUMBS & TOP HERO
   ========================================== */
.calc-breadcrumbs-wrap {
    padding-top: 24px;
    margin-bottom: 16px;
}

.calc-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 28px;
}

.calc-hero-title-area {
    flex: 1;
}

.calc-hero-h1 {
    font-size: clamp(1.65rem, 5vw, 2.15rem);
    font-weight: 850;
    color: #0b2d5b;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.calc-hero-sub {
    font-size: 1.05rem;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.calc-hero-notice {
    flex: 1;
    max-width: 520px;
    background: #eef6ff;
    border: 1px solid #c7e0fa;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #1e40af;
}

.calc-hero-notice i {
    font-size: 18px;
    color: #0064ce;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================
   MAIN 2-COLUMN SECTION: INPUTS & RESULTS
   ========================================== */
.calc-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 28px;
    margin-bottom: 28px;
    align-items: stretch;
}

.calc-panel-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.calc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.calc-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.calc-panel-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.calc-panel-icon-badge.badge-blue { background: #eff6ff; color: #0064ce; }
.calc-panel-icon-badge.badge-green { background: #f0fdf4; color: #16a34a; }
.calc-panel-icon-badge.badge-purple { background: #faf5ff; color: #9333ea; }

.calc-panel-title-wrap h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0b2d5b;
    margin: 0 0 2px;
    line-height: 1.2;
}

.calc-panel-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* 2x2 Input Grid */
.calc-inputs-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.calc-input-block {
    display: flex;
    flex-direction: column;
}

.calc-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
    color: #1e293b;
    margin-bottom: 8px;
}

.calc-info-icon {
    font-size: 13px;
    color: #94a3b8;
    cursor: help;
}

.calc-stepper-control {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 4px 6px;
    gap: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.calc-stepper-control:focus-within {
    border-color: #0064ce;
    box-shadow: 0 0 0 3px rgba(0, 100, 206, 0.12);
}

.calc-stepper-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    text-align: left;
    font-size: 1.15rem;
    font-weight: 750;
    color: #0f172a;
    padding: 6px 12px;
    -moz-appearance: textfield;
}
.calc-stepper-input::-webkit-outer-spin-button,
.calc-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-stepper-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0064ce;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
    padding: 0;
    user-select: none;
}
.calc-stepper-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.calc-field-note {
    font-size: 11px;
    color: #64748b;
    margin: 6px 0 0;
    line-height: 1.35;
}

/* Reduction Range Slider */
.calc-reduction-box {
    margin-bottom: 22px;
}

.calc-reduction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calc-reduction-pill {
    background: #ffffff;
    color: #0b2d5b;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.calc-slider-wrapper {
    position: relative;
    margin-bottom: 6px;
}

.calc-range-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.calc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0064ce;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 100, 206, 0.4);
    transition: transform 0.15s ease;
}
.calc-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.calc-range-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0064ce;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 100, 206, 0.4);
}

.calc-slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    padding: 0 2px;
}

/* Currency Selector */
.calc-currency-box {
    margin-bottom: 10px;
}

.calc-currency-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.calc-currency-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.calc-currency-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.calc-currency-btn.active {
    background: #0064ce;
    color: #ffffff;
    border-color: #0064ce;
    box-shadow: 0 4px 12px rgba(0, 100, 206, 0.2);
}

.calc-rate-curr-tag {
    font-weight: 700;
    color: #0064ce;
    margin-left: 4px;
}

/* ==========================================
   RESULTS PANEL (RIGHT COLUMN)
   ========================================== */
.calc-period-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.calc-period-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}
.calc-period-btn.active {
    background: #0064ce;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 100, 206, 0.2);
}

/* Top 3 Metric Cards */
.calc-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.calc-metric-card {
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.calc-metric-card.card-blue {
    background: #f0f7ff;
    border: 1px solid #dbeafe;
}
.calc-metric-card.card-green {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.calc-metric-card.card-purple {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
}

.calc-metric-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.calc-metric-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
}
.card-blue .calc-metric-icon { background: #e0f2fe; color: #0284c7; }
.card-green .calc-metric-icon { background: #dcfce7; color: #16a34a; }
.card-purple .calc-metric-icon { background: #f3e8ff; color: #9333ea; }

.calc-metric-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}
.card-blue .calc-metric-label { color: #0369a1; }
.card-green .calc-metric-label { color: #15803d; }
.card-purple .calc-metric-label { color: #7e22ce; }

.calc-metric-val {
    font-size: clamp(1.4rem, 2vw, 1.85rem);
    font-weight: 850;
    line-height: 1.1;
    margin-bottom: 6px;
}
.card-blue .calc-metric-val { color: #0369a1; }
.card-green .calc-metric-val { color: #15803d; }
.card-purple .calc-metric-val { color: #7e22ce; }

.calc-metric-sub {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-blue .calc-metric-sub { color: #0284c7; }
.card-green .calc-metric-sub { color: #16a34a; }
.card-purple .calc-metric-sub { color: #9333ea; }

.calc-badge-sm {
    background: #dcfce7;
    color: #166534;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 10.5px;
    font-weight: 750;
    width: fit-content;
}

/* ==========================================
   HORIZONTAL TIME COMPARISON BAR CHART
   ========================================== */
.calc-horizontal-chart-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.calc-hchart-title {
    font-size: 13.5px;
    font-weight: 750;
    color: #0f172a;
    margin: 0 0 16px;
}

.calc-hchart-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
}

.calc-hchart-row {
    display: grid;
    grid-template-columns: 145px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.calc-hchart-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.calc-hchart-track {
    background: #f1f5f9;
    height: 24px;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.calc-hbar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.35s ease;
    min-width: 8px;
}
.calc-hbar-fill.bar-slate {
    background: #94a3b8;
}
.calc-hbar-fill.bar-emerald {
    background: #22c55e;
}

.calc-hchart-val {
    font-size: 12.5px;
    font-weight: 750;
    color: #0f172a;
    text-align: left;
}

.calc-hchart-axis {
    display: flex;
    justify-content: space-between;
    margin-left: 157px;
    margin-right: 60px;
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: #94a3b8;
}

/* 3 Action Buttons */
.calc-action-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.calc-btn-primary-action {
    background: #0064ce;
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 750;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 100, 206, 0.25);
    transition: all 0.15s ease;
    min-width: 0;
    text-align: center;
}
.calc-btn-primary-action:hover {
    background: #0053ad;
    transform: translateY(-1px);
}

.calc-btn-white-action {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 12px;
    font-size: 12.5px;
    font-weight: 750;
    color: #0064ce;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 0;
    text-align: center;
}
.calc-btn-white-action:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ==========================================
   SECTION 3: COMPARE DIFFERENT SCENARIOS
   ========================================== */
.calc-compare-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    margin-bottom: 28px;
}

.calc-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}

.calc-scenarios-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.calc-scenario-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.2s ease;
    min-width: 0;
}
.calc-scenario-card.active-scenario {
    border: 1.5px solid #22c55e;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.1);
    background: #fafffb;
}

/* Floating pill for active scenario */
.calc-sc-floating-pill {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

.calc-sc-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.calc-sc-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #0b2d5b;
}

.calc-sc-sub {
    font-size: 11.5px;
    color: #64748b;
    margin: 0 0 18px;
}

.calc-sc-stepper-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px 4px;
}

.calc-sc-stepper-input {
    width: 34px;
    border: none;
    outline: none;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
    color: #0f172a;
    background: transparent;
    -moz-appearance: textfield;
}
.calc-sc-stepper-input::-webkit-outer-spin-button,
.calc-sc-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-sc-stepper-unit {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    padding-right: 4px;
}

.calc-sc-stepper-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0064ce;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}
.calc-sc-stepper-btn:hover {
    background: #eff6ff;
}

.calc-sc-metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.calc-sc-metric-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.calc-sc-metric-icon {
    font-size: 16px;
    margin-top: 1px;
}
.calc-sc-metric-icon.icon-blue { color: #0284c7; }
.calc-sc-metric-icon.icon-green { color: #16a34a; }
.calc-sc-metric-icon.icon-purple { color: #9333ea; }

.calc-sc-val {
    font-size: 1.15rem;
    font-weight: 850;
    color: #0f172a;
    line-height: 1.1;
}

.calc-sc-unit {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 2px;
}

/* Action button at bottom right of card */
.calc-sc-action-row {
    display: flex;
    justify-content: flex-end;
}

.calc-sc-btn {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #0064ce;
    background: #ffffff;
    color: #0064ce;
    display: flex;
    align-items: center;
    gap: 6px;
}
.calc-sc-btn:hover {
    background: #eff6ff;
}
.calc-scenario-card.active-scenario .calc-sc-btn {
    border-color: #16a34a;
    background: #ffffff;
    color: #16a34a;
}

/* ==========================================
   BOTTOM ROW: COMPACT ACCORDION & NEXT STEPS
   ========================================== */
.calc-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.calc-bottom-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.calc-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.calc-accordion-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0b2d5b;
    margin: 0;
}

.calc-accordion-chevron {
    font-size: 18px;
    color: #64748b;
    transition: transform 0.2s ease;
}
.calc-accordion-header[aria-expanded="true"] .calc-accordion-chevron {
    transform: rotate(180deg);
}

.calc-accordion-content {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.calc-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
    color: #334155;
    margin-bottom: 12px;
}

.calc-next-steps-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}

.calc-next-steps-info {
    flex: 1;
    min-width: 0;
}

.calc-next-steps-info h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0b2d5b;
    margin: 0 0 4px;
}

.calc-next-steps-info p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.calc-next-steps-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.calc-link-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.calc-link-card-btn:hover {
    border-color: #0064ce;
    color: #0064ce;
    background: #f8fafc;
}

.calc-link-card-btn i.bi-file-earmark-text {
    color: #0064ce;
}
.calc-link-card-btn i.bi-display {
    color: #7c3aed;
}

/* Toast Notification */
.calc-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0b2d5b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.calc-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   RESPONSIVENESS (MOBILE / TABLET)
   ========================================== */
@media (max-width: 1180px) {
    .calc-action-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1080px) {
    .calc-hero-header {
        flex-direction: column;
        gap: 16px;
    }
    .calc-hero-notice {
        max-width: 100%;
    }
    .calc-main-grid {
        grid-template-columns: 1fr;
    }
    .calc-scenarios-grid {
        grid-template-columns: 1fr;
    }
    .calc-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .calc-inputs-2x2 {
        grid-template-columns: 1fr;
    }
    .calc-metrics-row {
        grid-template-columns: 1fr;
    }
    .calc-action-buttons {
        grid-template-columns: 1fr;
    }
    .calc-hchart-row {
        grid-template-columns: 110px 1fr 50px;
    }
    .calc-hchart-axis {
        margin-left: 122px;
        margin-right: 50px;
    }
    .calc-next-steps-actions {
        flex-direction: column;
        width: 100%;
    }
    .calc-link-card-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .calc-pro-container {
        padding-inline: 16px;
    }
    .calc-panel-card,
    .calc-compare-section,
    .calc-bottom-card {
        padding: 22px 18px;
        border-radius: 16px;
    }
    .calc-currency-options {
        flex-direction: column;
    }
    .calc-period-toggle {
        margin-top: 8px;
    }
    .calc-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 520px) {
    .calc-hchart-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .calc-hchart-axis {
        display: none;
    }
    .calc-hero-h1 {
        font-size: 1.8rem;
    }
}
