/* מחשבון "לאן הכסף הולך" – calculator.html
   מובייל־פירסט. צבע ראשי #1A2751, פונט Rubik.
   צבעי הסטטוס: ירוק ואדום מה-CSS הקיים באתר, ענבר לפי הפלטה שאושרה. */

:root {
    --mc-navy: #1A2751;
    --mc-navy-soft: #24346a;
    --mc-accent: #365db4;          /* הכחול הקיים באתר */
    --mc-ink: #111827;
    --mc-text: #374151;
    --mc-muted: #4b5563;
    --mc-line: #e5e7eb;
    --mc-field: #cbd5e1;
    --mc-bg: #f8fafc;
    --mc-white: #ffffff;

    --mc-green: #16a34a;           /* קיים באתר */
    --mc-green-text: #065f46;      /* קיים באתר – לטקסט קטן (ניגודיות AA) */
    --mc-green-bg: #ecfdf5;
    --mc-yellow: #b45309;          /* ענבר – אושר */
    --mc-yellow-bg: #fef3c7;
    --mc-red: #b91c1c;             /* קיים באתר */
    --mc-red-bg: #fef2f2;

    --mc-fixed: #1A2751;           /* פילוח: הוצאות קבועות */
    --mc-variable: #6b8fd6;        /* פילוח: הוצאות משתנות */
    --mc-saving: #16a34a;          /* פילוח: חיסכון */
    --mc-left: #cbd5e1;            /* פילוח: מה שנשאר */

    --mc-radius: 16px;
    --mc-shadow: 0 6px 24px rgba(26, 39, 81, 0.07);
}

/* ביטול ה-scroll-snap של style.css – בעמוד הזה הגלילה רציפה */
body.mc-page {
    font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--mc-ink);
    background: var(--mc-bg);
    scroll-snap-type: none;
    line-height: 1.6;
}

.mc-page section {
    scroll-snap-align: none;
}

.mc-page [id] {
    scroll-margin-top: 110px;
}

.mc-page button,
.mc-page input {
    font-family: inherit;
}

.mc-page :focus-visible {
    outline: 3px solid var(--mc-accent);
    outline-offset: 2px;
}

.mc-skip {
    position: absolute;
    top: -100px;
    inset-inline-start: 12px;
    z-index: 2000;
    background: var(--mc-white);
    color: var(--mc-navy);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
}

.mc-skip:focus {
    top: 110px;
}

.mc-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

.mc-wrap-narrow {
    max-width: 720px;
}

/* ===== כפתורים ===== */

.mc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 26px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mc-btn-primary {
    background: var(--mc-navy);
    color: var(--mc-white);
}

.mc-btn-primary:hover {
    background: var(--mc-navy-soft);
}

.mc-btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.mc-btn-ghost {
    background: transparent;
    color: var(--mc-navy);
    border-color: var(--mc-field);
}

.mc-btn-ghost:hover {
    border-color: var(--mc-navy);
}

.mc-btn-light {
    background: var(--mc-white);
    color: var(--mc-navy);
}

.mc-btn-light:hover {
    background: #e8edf8;
}

.mc-btn-outline-light {
    background: transparent;
    color: var(--mc-white);
    border-color: rgba(255, 255, 255, 0.7);
}

.mc-btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--mc-white);
}

.mc-btn-block {
    width: 100%;
}

.mc-link-btn {
    display: block;
    margin: 20px auto 0;
    background: none;
    border: none;
    color: var(--mc-accent);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px;
}

/* ===== 1. פתיחה ===== */

.mc-hero {
    background: var(--mc-navy);
    color: var(--mc-white);
    text-align: center;
    padding: 56px 0 60px;
}

.mc-hero h1 {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 14px;
}

.mc-hero-sub {
    font-size: 1.08rem;
    max-width: 560px;
    margin: 0 auto 28px;
    color: #e5e9f5;
}


/* ===== מקטעים כלליים ===== */

.mc-section {
    padding: 52px 0;
}

.mc-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--mc-navy);
    text-align: center;
    margin-bottom: 28px;
}

.mc-card {
    background: var(--mc-white);
    border: 1px solid var(--mc-line);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    padding: 24px 18px;
}

/* ===== 2. איך זה עובד ===== */

.mc-steps {
    list-style: none;
    display: grid;
    gap: 16px;
}

.mc-step-card {
    position: relative;
    background: var(--mc-white);
    border: 1px solid var(--mc-line);
    border-radius: var(--mc-radius);
    padding: 22px 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.mc-step-icon {
    flex: 0 0 48px;
    height: 48px;
    border-radius: 12px;
    background: #eef2fb;
    color: var(--mc-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.mc-step-num {
    position: absolute;
    top: 12px;
    inset-inline-end: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mc-muted);
}

.mc-step-card p {
    color: var(--mc-text);
    font-size: 1rem;
    padding-inline-end: 18px;
}

.mc-calc-section {
    background: #eef1f7;
}

/* ===== 3. האשף ===== */

.mc-progress {
    margin-bottom: 22px;
}

.mc-progress-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--mc-muted);
    margin-bottom: 8px;
}

.mc-progress-track {
    height: 8px;
    background: var(--mc-line);
    border-radius: 999px;
    overflow: hidden;
}

.mc-progress-fill {
    height: 100%;
    width: 25%;
    background: var(--mc-navy);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.mc-step-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--mc-navy);
    margin-bottom: 18px;
}

.mc-step-title:focus {
    outline: none;
}

.mc-field {
    margin-bottom: 18px;
}

.mc-field label,
.mc-fieldset legend {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--mc-ink);
    margin-bottom: 4px;
}

.mc-hint {
    font-size: 0.85rem;
    color: var(--mc-muted);
    margin-top: 5px;
}

.mc-input-wrap {
    position: relative;
}

.mc-field input[type="text"],
.mc-field input[type="tel"],
.mc-field input[type="email"] {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--mc-field);
    border-radius: 10px;
    background: var(--mc-white);
    font-size: 16px; /* מונע זום אוטומטי באייפון */
    color: var(--mc-ink);
}

.mc-input-wrap input {
    padding-inline-end: 40px !important;
    font-weight: 500;
}

.mc-currency {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mc-muted);
    pointer-events: none;
}

.mc-field input:focus {
    border-color: var(--mc-accent);
}

.mc-field input[aria-invalid="true"] {
    border-color: var(--mc-red);
}

.mc-fieldset {
    border: none;
    margin-bottom: 18px;
}

.mc-sign {
    display: inline-flex;
    border: 1px solid var(--mc-field);
    border-radius: 999px;
    padding: 3px;
    margin: 4px 0 10px;
}

.mc-sign input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.mc-sign label {
    margin: 0;
    padding: 8px 22px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
    color: var(--mc-text);
}

.mc-sign input:checked + label {
    background: var(--mc-navy);
    color: var(--mc-white);
}

.mc-sign input:focus-visible + label {
    outline: 3px solid var(--mc-accent);
    outline-offset: 2px;
}

.mc-subtotal {
    margin-top: 6px;
    padding: 14px 16px;
    background: #f1f4fa;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-weight: 500;
    color: var(--mc-navy);
}

.mc-subtotal strong {
    font-size: 1.2rem;
    font-weight: 700;
}

.mc-nav {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.mc-nav .mc-btn {
    flex: 1;
}

.mc-nav #prevBtn[hidden] {
    display: none;
}

/* מספרים: תמיד משמאל לימין כדי שסימן המינוס יופיע במקום הנכון */
.mc-num {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

/* ===== 4. השארת פרטים ===== */

.mc-lead-title,
.mc-results-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mc-navy);
    text-align: center;
    margin-bottom: 18px;
}

.mc-lead-title:focus,
.mc-results-title:focus {
    outline: none;
}

.mc-req,
.mc-opt {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--mc-muted);
}

.mc-error {
    font-size: 0.9rem;
    color: var(--mc-red);
    margin-top: 5px;
}

.mc-error:empty {
    display: none;
}

.mc-form-error {
    text-align: center;
    margin-top: 12px;
}

.mc-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0 22px;
    font-size: 0.95rem;
    color: var(--mc-text);
}

.mc-check input {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--mc-navy);
}

.mc-check a {
    color: var(--mc-accent);
}

/* ===== 5. תוצאות ===== */

.mc-res-grid {
    display: grid;
    gap: 16px;
}

.mc-hero-card {
    text-align: center;
    border-top: 6px solid var(--mc-status, var(--mc-navy));
}

.mc-hero-card .mc-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--mc-muted);
}

.mc-big {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.15;
    margin: 6px 0 10px;
    color: var(--mc-status, var(--mc-navy));
}

.mc-forecast {
    font-size: 1.08rem;
    font-weight: 500;
    color: var(--mc-ink);
    max-width: 480px;
    margin: 0 auto 16px;
}

.mc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid currentColor;
}

.mc-badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.mc-status-red { --mc-status: var(--mc-red); }
.mc-status-yellow { --mc-status: var(--mc-yellow); }
.mc-status-green { --mc-status: var(--mc-green); }

.mc-status-red .mc-badge { color: var(--mc-red); background: var(--mc-red-bg); }
.mc-status-yellow .mc-badge { color: var(--mc-yellow); background: var(--mc-yellow-bg); }
.mc-status-green .mc-badge { color: var(--mc-green-text); background: var(--mc-green-bg); }

.mc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mc-stat {
    background: var(--mc-white);
    border: 1px solid var(--mc-line);
    border-radius: 14px;
    padding: 14px 14px;
}

.mc-stat-label {
    font-size: 0.85rem;
    color: var(--mc-muted);
    margin-bottom: 4px;
}

.mc-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mc-navy);
}

.mc-stat-value.is-neg {
    color: var(--mc-red);
}

.mc-chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mc-navy);
    margin-bottom: 14px;
}

/* גרף טבעת */
.mc-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.mc-donut {
    width: 200px;
    height: 200px;
    flex: 0 0 auto;
}

.mc-donut-center-big {
    font-family: "Rubik", sans-serif;
    font-size: 22px;
    font-weight: 900;
    fill: var(--mc-navy);
}

.mc-donut-center-small {
    font-family: "Rubik", sans-serif;
    font-size: 11px;
    fill: var(--mc-muted);
}

.mc-legend {
    list-style: none;
    width: 100%;
    display: grid;
    gap: 8px;
}

.mc-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.mc-swatch {
    flex: 0 0 14px;
    height: 14px;
    border-radius: 4px;
}

.mc-swatch-over {
    background: repeating-linear-gradient(45deg, var(--mc-red) 0 3px, #fca5a5 3px 6px);
}

.mc-legend-name {
    flex: 1;
}

.mc-legend-val {
    font-weight: 700;
}

.mc-legend-pct {
    color: var(--mc-muted);
    font-size: 0.85rem;
    min-width: 42px;
    text-align: left;
}

.mc-over-note {
    width: 100%;
    background: var(--mc-red-bg);
    color: var(--mc-red);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 500;
    font-size: 0.95rem;
}

/* עמודות אופקיות */
.mc-bars {
    list-style: none;
    display: grid;
    gap: 14px;
}

.mc-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.mc-bar-head strong {
    font-weight: 700;
    color: var(--mc-navy);
}

.mc-bar-track {
    height: 14px;
    background: #eef1f7;
    border-radius: 999px;
    overflow: hidden;
}

.mc-bar-fill {
    height: 100%;
    background: var(--mc-navy);
    border-radius: 999px;
}

.mc-empty {
    color: var(--mc-muted);
    font-size: 0.95rem;
}

/* מד הוצאות קבועות */
.mc-meter-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--mc-navy);
    line-height: 1.1;
}

.mc-meter-sub {
    font-size: 0.9rem;
    color: var(--mc-muted);
    margin-bottom: 12px;
}

.mc-meter-track {
    position: relative;
    height: 16px;
    background: #eef1f7;
    border-radius: 999px;
    overflow: hidden;
}

.mc-meter-fill {
    height: 100%;
    background: var(--mc-navy);
    border-radius: 999px;
}

.mc-meter-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--mc-muted);
    margin-top: 4px;
}

/* ===== 6. קריאה לפעולה ===== */

.mc-cta {
    background: var(--mc-navy);
    color: var(--mc-white);
    padding: 56px 0;
    text-align: center;
}

.mc-cta h2 {
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 28px;
}

.mc-cta-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

/* ===== 7. כותרת תחתונה ===== */

.mc-page .site-footer {
    background: #0f1730;
}

.mc-page .footer-title {
    font-size: 0.95rem;
}

.mc-page .footer-desc {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.mc-page .footer-links a,
.mc-page .footer-contact span,
.mc-page .footer-contact .mc-footer-link {
    color: #cbd5e1;
}

.mc-footer-link {
    text-decoration: none;
}

.mc-disclaimer {
    max-width: 1200px;
    margin: 26px auto 0;
    font-size: 0.85rem;
    color: #cbd5e1;
    text-align: center;
    display: grid;
    gap: 6px;
}

.mc-disclaimer a {
    color: #ffffff;
}

.mc-page .footer-bottom {
    color: #aab3c5;
    justify-content: center;
}

/* ===== טאבלט ומעלה ===== */

@media (min-width: 640px) {
    .mc-hero {
        padding: 80px 0 84px;
    }

    .mc-hero h1 {
        font-size: 2.7rem;
    }

    .mc-card {
        padding: 32px 32px;
    }

    .mc-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .mc-donut-wrap {
        flex-direction: row;
        align-items: center;
    }

    .mc-cta-btns {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .mc-nav .mc-btn {
        flex: 0 0 auto;
        min-width: 140px;
    }

    .mc-nav {
        justify-content: space-between;
    }

    .mc-nav #nextBtn {
        margin-inline-start: auto;
    }
}

@media (min-width: 900px) {
    .mc-steps {
        grid-template-columns: repeat(3, 1fr);
    }

    .mc-step-card {
        flex-direction: column;
    }

    .mc-step-card p {
        padding-inline-end: 0;
    }

    .mc-title {
        font-size: 1.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mc-page *,
    html {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* ===== כרטיסי קטגוריה עם ריבועים (שלבים 2–3) ===== */

.mc-group {
    border: 1px solid var(--mc-line);
    border-radius: 14px;
    padding: 14px 12px 12px;
    margin-bottom: 14px;
    background: #fbfcfe;
}

.mc-group-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.mc-group-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--mc-navy);
}

.mc-group-sum {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mc-navy);
}

.mc-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mc-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    background: var(--mc-white);
    border: 1px solid var(--mc-line);
    border-radius: 12px;
    padding: 10px;
}

.mc-tile:focus-within {
    border-color: var(--mc-accent);
}

.mc-tile label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--mc-ink);
    line-height: 1.35;
}

.mc-tile input {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    padding-inline-end: 30px !important;
    border: 1px solid var(--mc-field);
    border-radius: 8px;
    background: var(--mc-white);
    font-size: 16px; /* מונע זום אוטומטי באייפון */
    color: var(--mc-ink);
}

.mc-tile .mc-currency {
    inset-inline-end: 10px;
    font-size: 0.9rem;
}

/* ===== תוצאות: הכנסות פחות הוצאות, קבועות מול משתנות ===== */

.mc-sub-line {
    font-size: 0.95rem;
    color: var(--mc-muted);
    margin-bottom: 12px;
}

.mc-sub-line strong {
    color: var(--mc-ink);
}

.mc-split-total {
    font-size: 1rem;
    color: var(--mc-text);
    margin-bottom: 12px;
}

.mc-split-total strong {
    color: var(--mc-navy);
    font-size: 1.15rem;
}

.mc-split-bar {
    display: flex;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef1f7;
}

.mc-split-fixed {
    background: var(--mc-fixed);
}

.mc-split-variable {
    background: var(--mc-variable);
}

.mc-split-legend {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.mc-split-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

@media (min-width: 640px) {
    .mc-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mc-group {
        padding: 16px;
    }
}

/* ===== הודעת פרטיות והשארת פרטים (רשות) ===== */

.mc-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--mc-muted);
    margin-top: 14px;
}

.mc-privacy-note i {
    margin-top: 4px;
    color: var(--mc-navy);
}

.mc-results .mc-privacy-note {
    justify-content: center;
    text-align: center;
    margin: -6px 0 18px;
}

.mc-results + .mc-lead {
    margin-top: 28px;
}

.mc-lead-note {
    text-align: center;
    color: var(--mc-text);
    max-width: 520px;
    margin: -6px auto 22px;
}

.mc-lead-success {
    text-align: center;
    font-weight: 700;
    color: var(--mc-green-text);
    background: var(--mc-green-bg);
    border-radius: 12px;
    padding: 16px;
}

.mc-lead-success:focus {
    outline: none;
}

/* ===== שווי נקי ===== */

.mc-nw-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--mc-navy);
    line-height: 1.1;
}

.mc-nw-value.is-neg {
    color: var(--mc-red);
}

.mc-fill-assets {
    background: var(--mc-green);
}

.mc-fill-liabilities {
    background: var(--mc-red);
}

.mc-nw-details {
    font-size: 0.85rem;
    color: var(--mc-muted);
    margin-top: 6px;
}
