/* =============================================================
   Zakat Calculator v4 – As-Sunnah Foundation Style (2-step)
   ============================================================= */
:root {
    --zc-green:       #1a6b3a;
    --zc-green-light: #2d8653;
    --zc-green-pale:  #e8f5ee;
    --zc-gold:        #b8860b;
    --zc-gold-pale:   #fdf8e8;
    --zc-silver:      #6b7280;
    --zc-silver-pale: #f3f4f6;
    --zc-red:         #b91c1c;
    --zc-red-pale:    #fef2f2;
    --zc-blue:        #1d4ed8;
    --zc-border:      #e5e7eb;
    --zc-bg:          #f7f8fa;
    --zc-white:       #ffffff;
    --zc-text:        #1f2937;
    --zc-muted:       #6b7280;
    --zc-radius:      10px;
    --zc-radius-sm:   6px;
    --zc-shadow:      0 2px 12px rgba(0,0,0,.07);
    --zc-shadow-lg:   0 8px 32px rgba(0,0,0,.12);
}

/* ── Wrapper ─────────────────────────────────────────────────── */
.zakat-calc-wrap {
    max-width: 1080px;
    margin: 32px auto;
    background: var(--zc-bg);
    border-radius: 16px;
    box-shadow: var(--zc-shadow-lg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Bengali',
                 'Noto Sans Assamese', 'Noto Nastaliq Urdu', Roboto, sans-serif;
    color: var(--zc-text);
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────── */
.zc-header {
    background: linear-gradient(135deg, var(--zc-green) 0%, var(--zc-green-light) 100%);
    color: #fff;
    padding: 32px 32px 24px;
    text-align: center;
}
.zc-title    { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.zc-subtitle { margin: 0; font-size: 13.5px; opacity: .87; line-height: 1.6; max-width: 680px; margin: 0 auto; }

/* ── Body layout (2-column) ──────────────────────────────────── */
.zc-body-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

/* ── Form area (left col) ────────────────────────────────────── */
.zc-form-area {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 24px;
    border-right: 1px solid var(--zc-border);
}

.zc-blank-note {
    font-size: 13px;
    color: var(--zc-muted);
    background: #f8f9fa;
    border-left: 3px solid var(--zc-green-light);
    padding: 8px 14px;
    margin: 0 0 18px;
    border-radius: 0 var(--zc-radius-sm) var(--zc-radius-sm) 0;
    line-height: 1.5;
}

/* ── Step indicator ──────────────────────────────────────────── */
.zc-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    justify-content: center;
}
.zc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: default;
}
.zc-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #d1d5db;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.zc-step.active .zc-step-circle,
.zc-step.completed .zc-step-circle {
    background: var(--zc-green);
}
.zc-step.completed .zc-step-circle::before { content: '✓'; }
.zc-step.completed .zc-step-circle { font-size: 0; }
.zc-step.completed .zc-step-circle::before { font-size: 15px; }
.zc-step-label {
    font-size: 11.5px;
    color: var(--zc-muted);
    font-weight: 600;
}
.zc-step.active .zc-step-label { color: var(--zc-green); }
.zc-step-connector {
    flex: 1;
    height: 2px;
    background: #d1d5db;
    margin: 0 8px;
    margin-bottom: 20px;
    min-width: 60px;
}

/* ── Step panels ─────────────────────────────────────────────── */
.zc-step-panel { display: none; }
.zc-step-panel.active { display: block; }

/* ── Section heading ─────────────────────────────────────────── */
.zc-section-heading {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    padding: 11px 18px;
    border-radius: var(--zc-radius);
    margin-bottom: 12px;
}
.assets-heading { background: linear-gradient(90deg, #1a5276, #2471a3); }
.liab-heading   { background: linear-gradient(90deg, #a93226, #c0392b); }

/* ── Field row ───────────────────────────────────────────────── */
.zc-field {
    display: flex;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 12px;
    border-bottom: 1px solid #f3f4f6;
    background: var(--zc-white);
    transition: background .12s;
    border-radius: 6px;
    margin-bottom: 4px;
}
.zc-field:hover { background: #fafbfc; }

.zc-field-label {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding-top: 2px;
}
.zc-label-text {
    font-size: 13.5px;
    color: var(--zc-text);
    line-height: 1.5;
    flex: 1;
}
.zc-hint {
    font-size: 12px;
    color: var(--zc-muted);
    cursor: help;
    flex-shrink: 0;
    opacity: .65;
    transition: opacity .15s;
    position: relative;
    margin-top: 1px;
}
.zc-hint:hover { opacity: 1; }

/* Tooltip */
.zc-hint[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: 22px;
    right: 0;
    background: #1f2937;
    color: #fff;
    font-size: 11.5px;
    padding: 7px 11px;
    border-radius: 5px;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    z-index: 200;
    line-height: 1.45;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* Input with symbol */
.zc-field-input {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--zc-border);
    border-radius: var(--zc-radius-sm);
    background: #fafbfc;
    overflow: hidden;
    flex-shrink: 0;
    width: 160px;
    transition: border-color .2s, box-shadow .2s;
}
.zc-field-input:focus-within {
    border-color: var(--zc-green-light);
    box-shadow: 0 0 0 3px rgba(45,134,83,.12);
    background: #fff;
}
.zc-sym {
    padding: 0 7px 0 9px;
    font-size: 13px;
    color: var(--zc-muted);
    background: #f3f4f6;
    border-right: 1px solid var(--zc-border);
    height: 100%;
    display: flex;
    align-items: center;
    user-select: none;
    white-space: nowrap;
    min-height: 36px;
}
.zc-input {
    width: 100%;
    padding: 8px 10px 8px 7px;
    border: none;
    outline: none;
    font-size: 14px;
    text-align: right;
    background: transparent;
    color: var(--zc-text);
    min-height: 36px;
}
.zc-input::placeholder { color: #c4c8cc; }

/* ── Mini summary (step 2 top) ───────────────────────────────── */
.zc-mini-summary {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--zc-radius-sm);
    padding: 10px 16px;
    margin: 16px 0 12px;
    font-size: 13px;
}
.zc-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    color: var(--zc-text);
}
.zc-mini-assets { font-weight: 700; color: #1a5276; }
.zc-mini-liabs  { font-weight: 700; color: #a93226; }

/* ── Actions ─────────────────────────────────────────────────── */
.zc-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    padding: 16px 0 4px;
    flex-wrap: wrap;
}
.zc-btn {
    padding: 11px 26px;
    border: none;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.zc-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(0,0,0,.18); }
.zc-btn:active { transform: none; }
.zc-btn-calculate {
    background: linear-gradient(135deg, var(--zc-green), var(--zc-green-light));
    color: #fff;
    box-shadow: 0 3px 12px rgba(26,107,58,.3);
}
.zc-btn-next {
    background: linear-gradient(135deg, #1a5276, #2471a3);
    color: #fff;
    box-shadow: 0 3px 12px rgba(26,82,118,.3);
}
.zc-btn-prev {
    background: #e9ecef;
    color: #495057;
}
.zc-btn-reset {
    background: #e9ecef;
    color: #495057;
}
.zc-btn-reset:hover,
.zc-btn-prev:hover { background: #dee2e6; }

/* ── Sidebar (right col) ─────────────────────────────────────── */
.zc-sidebar {
    width: 290px;
    flex-shrink: 0;
    padding: 20px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Nisab box */
.zc-nisab-box {
    background: #fff;
    border: 1px solid var(--zc-border);
    border-radius: var(--zc-radius);
    padding: 16px 18px;
    box-shadow: var(--zc-shadow);
}
.zc-nisab-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--zc-green);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}
.zc-nisab-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--zc-text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.zc-nisab-info {
    font-size: 14px;
    color: var(--zc-muted);
    cursor: help;
    font-weight: 400;
}
.zc-nisab-updated {
    font-size: 11.5px;
    color: var(--zc-green-light);
    margin-top: 4px;
    text-decoration: underline;
    cursor: default;
}

/* Info box */
.zc-info-box {
    background: #fff;
    border: 1px solid var(--zc-border);
    border-radius: var(--zc-radius);
    padding: 14px 18px;
    box-shadow: var(--zc-shadow);
}
.zc-info-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--zc-text);
    margin-bottom: 10px;
}
.zc-info-list {
    margin: 0;
    padding: 0 0 0 16px;
    list-style: disc;
}
.zc-info-list li {
    font-size: 12px;
    color: var(--zc-muted);
    line-height: 1.5;
    margin-bottom: 6px;
}
.zc-info-list li:last-child { margin-bottom: 0; }

/* Warning box */
.zc-warning-box {
    background: #fff8f0;
    border: 1px solid #f5c06e;
    border-radius: var(--zc-radius);
    padding: 14px 18px;
}
.zc-warning-title {
    font-size: 14px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 8px;
}
.zc-warning-text {
    font-size: 12px;
    color: #7d6b55;
    line-height: 1.6;
    margin: 0;
}

/* ── Results ─────────────────────────────────────────────────── */
.zc-results {
    margin: 0 24px 24px;
    background: var(--zc-white);
    border: 1px solid var(--zc-border);
    border-radius: var(--zc-radius);
    overflow: hidden;
    box-shadow: var(--zc-shadow);
    animation: zcSlide .35s ease;
}
@keyframes zcSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.zc-results-title {
    background: linear-gradient(90deg, #1c2833, #2c3e50);
    color: #fff;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
}

.zc-results-grid { padding: 4px 0; }
.zc-res-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}
.zc-res-row:last-child { border-bottom: none; }
.zc-res-label { font-size: 14px; color: var(--zc-muted); }
.zc-res-val   { font-size: 16px; font-weight: 700; color: var(--zc-text); }

.zc-val-assets  { color: #1a5276; }
.zc-val-liab    { color: #a93226; }
.zc-val-net     { color: var(--zc-green); font-size: 18px; }
.zc-val-nisab   { color: var(--zc-muted); }

.zc-res-divider { height: 1px; background: var(--zc-border); margin: 4px 0; }

.zc-status-box { padding: 12px 18px; border-top: 1px solid var(--zc-border); }
.zc-status-msg {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: var(--zc-radius-sm);
    line-height: 1.5;
}
.zc-status-msg.eligible   { background: var(--zc-green-pale); color: #1a5c30; border: 1px solid #a8d5b5; }
.zc-status-msg.ineligible { background: #fff3cd;              color: #856404; border: 1px solid #ffc107; }

.zc-zakat-due-box {
    text-align: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--zc-green), var(--zc-green-light));
    color: #fff;
}
.zc-due-label  { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; opacity: .85; margin-bottom: 4px; }
.zc-due-rate   { font-size: 13px; opacity: .7; margin-bottom: 8px; }
.zc-due-amount {
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.zc-disclaimer {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px 16px;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    font-size: 12.5px;
    color: #78350f;
    line-height: 1.5;
}
.zc-disclaimer-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }

/* ── RTL ─────────────────────────────────────────────────────── */
[dir="rtl"].zakat-calc-wrap .zc-field { flex-direction: row-reverse; }
[dir="rtl"] .zc-field-input           { flex-direction: row-reverse; }
[dir="rtl"] .zc-sym                   { border-right: none; border-left: 1px solid var(--zc-border); }
[dir="rtl"] .zc-input                 { text-align: left; }
[dir="rtl"] .zc-res-row               { flex-direction: row-reverse; }
[dir="rtl"] .zc-section-heading       { text-align: right; }
[dir="rtl"] .zc-disclaimer            { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .zc-actions               { flex-direction: row-reverse; }
[dir="rtl"] .zc-hint[title]:hover::after { right: auto; left: 0; }
[dir="rtl"] .zc-blank-note            { border-left: none; border-right: 3px solid var(--zc-green-light);
                                         border-radius: var(--zc-radius-sm) 0 0 var(--zc-radius-sm); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 820px) {
    .zc-body-layout  { flex-direction: column; }
    .zc-form-area    { border-right: none; border-bottom: 1px solid var(--zc-border); }
    .zc-sidebar      { width: 100%; padding: 16px 20px 20px; flex-direction: row; flex-wrap: wrap; gap: 12px; }
    .zc-nisab-box,
    .zc-info-box,
    .zc-warning-box  { flex: 1; min-width: 200px; }
}

@media (max-width: 600px) {
    .zakat-calc-wrap { margin: 16px auto; border-radius: 10px; }
    .zc-header       { padding: 22px 16px 18px; }
    .zc-title        { font-size: 20px; }
    .zc-subtitle     { font-size: 12.5px; }
    .zc-form-area    { padding: 14px 14px 18px; }
    .zc-field        { flex-direction: column; align-items: flex-start; padding: 10px 12px; gap: 7px; }
    .zc-field-input  { width: 100%; box-sizing: border-box; }
    .zc-results      { margin: 0 14px 16px; }
    .zc-due-amount   { font-size: 34px; }
    .zc-actions      { gap: 8px; }
    .zc-btn          { width: 100%; justify-content: center; }
    .zc-sidebar      { padding: 14px 14px 18px; }
    [dir="rtl"].zakat-calc-wrap .zc-field { flex-direction: column; align-items: flex-end; }
}
