*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:   #0d5c38;
  --green-main:   #1a7a4a;
  --green-light:  #2ecc71;
  --green-bg:     #eafaf1;
  --green-border: #a8dfc0;
  --blue-dark:    #0d3580;
  --blue-main:    #1a5fd4;
  --blue-light:   #60b0ff;
  --blue-bg:      #e8f3ff;
  --blue-border:  #aac8f0;
  --gold-dark:    #7a4800;
  --gold-main:    #c07000;
  --gold-light:   #f5a623;
  --gold-bg:      #fff8ec;
  --gold-border:  #f0d090;
  --red-bg:    #fff0f0;
  --red-main:  #e74c3c;
  --red-border:#f5b3b3;
  --bg:        #f0f5f1;
  --card-bg:   #ffffff;
  --text-dark: #1a2e22;
  --text-mid:  #4a6258;
  --text-muted:#8aada0;
  --border:    #e0ede8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, #0d5c38 0%, #1a7a4a 50%, #0d3580 100%);
  padding: 60px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-logo {
  height: 48px;
  margin: 0 auto 24px;
  display: block;
  animation: slideDown 0.6s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px; font-weight: 700;
  border-radius: 20px;
  padding: 6px 18px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.25);
}
.hero h1 {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 900; color: #fff;
  margin-bottom: 12px; line-height: 1.2;
}
.hero h1 span { color: #7fffb8; }
.hero p {
  font-size: clamp(14px, 2.5vw, 17px);
  color: rgba(255,255,255,0.80);
  max-width: 500px; margin: 0 auto 28px; line-height: 1.7;
}
.hero-pills { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff; border-radius: 30px;
  padding: 8px 20px; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.hero-pill .dot { width: 10px; height: 10px; border-radius: 50%; }

/* LAYOUT */
.main-wrap {
  max-width: 1060px;
  margin: -40px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 32px 28px;
}
.card-title {
  font-size: 16px; font-weight: 800; color: var(--text-dark);
  margin-bottom: 22px; display: flex; align-items: center; gap: 9px;
}
.card-title .icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: var(--green-bg); flex-shrink: 0;
}

/* Input */
.input-label { font-size: 13px; font-weight: 700; color: var(--text-mid); margin-bottom: 8px; display: block; }
.input-wrap { position: relative; margin-bottom: 16px; }
.input-wrap input {
  width: 100%;
  border: 2px solid var(--border); border-radius: 14px;
  padding: 15px 55px 15px 20px;
  font-size: 20px; font-weight: 800;
  font-family: 'Cairo', sans-serif; color: var(--text-dark);
  background: #f7fbf9; outline: none; transition: all 0.2s;
}
.input-wrap input:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 4px rgba(26,122,74,0.10);
  background: #fff;
}
.input-wrap input.error { border-color: var(--red-main); }
.input-wrap .suffix {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px; font-weight: 700; color: var(--text-muted); pointer-events: none;
}
.error-msg { font-size: 12px; color: var(--red-main); font-weight: 600; margin-top: -10px; margin-bottom: 14px; display: none; }
.error-msg.show { display: block; }

/* Slider */
.slider-wrap { margin-bottom: 20px; }
.slider-wrap input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: 99px;
  background: linear-gradient(to left, var(--green-light) 0%, var(--green-main) 100%);
  outline: none; cursor: pointer;
}
.slider-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--green-main);
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(26,122,74,0.4); cursor: pointer;
}
.slider-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 6px; }

/* Presets */
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.preset-btn {
  border: 1.5px solid var(--border); background: #f7fbf9; color: var(--text-mid);
  border-radius: 30px; padding: 6px 14px; font-size: 12px; font-weight: 700;
  font-family: 'Cairo', sans-serif; cursor: pointer; transition: all 0.15s;
}
.preset-btn:hover { border-color: var(--green-main); color: var(--green-main); background: var(--green-bg); }

.calc-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  color: #fff; border: none; border-radius: 14px;
  padding: 17px; font-size: 17px; font-weight: 800;
  font-family: 'Cairo', sans-serif; cursor: pointer;
  box-shadow: 0 6px 20px rgba(13,92,56,0.30);
  transition: all 0.2s;
}
.calc-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(13,92,56,0.38); }
.calc-btn:active { transform: translateY(0); }

/* Donut */
.donut-card { text-align: center; }
.donut-container { position: relative; width: 200px; height: 200px; margin: 0 auto 20px; }
.donut-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-center .dc-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.donut-center .dc-amount { font-size: 19px; font-weight: 900; color: var(--text-dark); line-height: 1.1; }
.donut-center .dc-unit { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; transition: background 0.15s; }
.legend-row:hover { background: #f7fbf9; }
.legend-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.legend-name { font-size: 13px; font-weight: 700; flex: 1; }
.legend-pct { font-size: 12px; font-weight: 700; }
.legend-amt { font-size: 14px; font-weight: 900; }

/* Category Cards */
.right-col { display: flex; flex-direction: column; gap: 20px; }
.cat-card {
  border-radius: 18px; padding: 20px 22px;
  display: flex; align-items: flex-start; gap: 16px;
  border: 1.5px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cat-card:hover { transform: translateX(-4px); box-shadow: 0 6px 24px rgba(0,0,0,0.08); }
.cat-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.cat-body { flex: 1; }
.cat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.cat-name { font-size: 16px; font-weight: 800; }
.cat-amount { font-size: 20px; font-weight: 900; }
.cat-unit { font-size: 11px; font-weight: 600; opacity: 0.7; }
.cat-pct-bar { height: 6px; border-radius: 99px; margin: 8px 0; overflow: hidden; }
.cat-pct-fill { height: 100%; border-radius: 99px; width: 0; transition: width 0.8s cubic-bezier(.4,0,.2,1); }
.cat-items { font-size: 12px; font-weight: 500; opacity: 0.75; line-height: 1.7; }

.cat-needs  { background: var(--green-bg);  border-color: var(--green-border); }
.cat-needs  .cat-icon   { background: #d0f5e3; }
.cat-needs  .cat-name   { color: var(--green-dark); }
.cat-needs  .cat-amount { color: var(--green-main); }
.cat-needs  .cat-pct-bar { background: #c2f0d8; }
.cat-needs  .cat-pct-fill { background: linear-gradient(90deg, var(--green-dark), var(--green-light)); }
.cat-needs  .cat-items  { color: var(--green-dark); }

.cat-wants  { background: var(--blue-bg);   border-color: var(--blue-border); }
.cat-wants  .cat-icon   { background: #cce4ff; }
.cat-wants  .cat-name   { color: var(--blue-dark); }
.cat-wants  .cat-amount { color: var(--blue-main); }
.cat-wants  .cat-pct-bar { background: #c0d8f5; }
.cat-wants  .cat-pct-fill { background: linear-gradient(90deg, var(--blue-dark), var(--blue-light)); }
.cat-wants  .cat-items  { color: var(--blue-dark); }

.cat-savings { background: var(--gold-bg);  border-color: var(--gold-border); }
.cat-savings .cat-icon  { background: #fdecc8; }
.cat-savings .cat-name  { color: var(--gold-dark); }
.cat-savings .cat-amount { color: var(--gold-main); }
.cat-savings .cat-pct-bar { background: #f0dba0; }
.cat-savings .cat-pct-fill { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.cat-savings .cat-items { color: var(--gold-dark); }

/* ACTUAL SPENDING CHECK */
.check-section { max-width: 1060px; margin: 0 auto 40px; padding: 0 20px; }
.check-card { background: var(--card-bg); border-radius: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); padding: 36px 32px; }
.check-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 14px; }
.check-header .card-title { margin-bottom: 0; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.check-col { display: flex; flex-direction: column; gap: 10px; }
.check-col-header { font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; }
.check-col-header .cdot { width: 10px; height: 10px; border-radius: 50%; }
.check-input-wrap { position: relative; }
.check-input-wrap input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 12px 46px 12px 14px; font-size: 15px; font-weight: 700;
  font-family: 'Cairo', sans-serif; color: var(--text-dark);
  background: #f7fbf9; outline: none; transition: all 0.2s;
}
.check-input-wrap input:focus { border-color: var(--green-main); background: #fff; }
.check-input-wrap .sfx { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--text-muted); pointer-events: none; }
.check-meta { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.status-tag { border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; text-align: center; display: none; }
.status-tag.show { display: block; }
.tag-ok   { background: var(--green-bg);  color: var(--green-dark); border: 1px solid var(--green-border); }
.tag-warn { background: var(--gold-bg);   color: var(--gold-dark);  border: 1px solid var(--gold-border); }
.tag-bad  { background: var(--red-bg);    color: #c0001a;           border: 1px solid var(--red-border); }

/* Overall Banner */
.overall-banner { border-radius: 16px; padding: 20px 24px; display: flex; align-items: center; gap: 16px; display: none; }
.overall-banner.show { display: flex; }
.ob-icon { font-size: 32px; flex-shrink: 0; }
.ob-text .ob-title { font-size: 17px; font-weight: 900; margin-bottom: 4px; }
.ob-text .ob-desc  { font-size: 14px; font-weight: 500; opacity: 0.85; }
.banner-ok   { background: var(--green-bg); border: 1.5px solid var(--green-border); }
.banner-ok   .ob-title { color: var(--green-dark); }
.banner-ok   .ob-desc  { color: var(--green-main); }
.banner-warn { background: var(--gold-bg); border: 1.5px solid var(--gold-border); }
.banner-warn .ob-title { color: var(--gold-dark); }
.banner-warn .ob-desc  { color: var(--gold-main); }
.banner-bad  { background: var(--red-bg); border: 1.5px solid var(--red-border); }
.banner-bad  .ob-title { color: #c0001a; }
.banner-bad  .ob-desc  { color: #900010; }

/* TIPS */
.tips-section { max-width: 1060px; margin: 0 auto 60px; padding: 0 20px; }
.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tip-card { background: var(--card-bg); border-radius: 20px; padding: 24px 22px; border: 1.5px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; }
.tip-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.09); }
.tip-emoji { font-size: 28px; margin-bottom: 12px; }
.tip-title { font-size: 14px; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; }
.tip-text  { font-size: 12.5px; font-weight: 500; color: var(--text-mid); line-height: 1.7; }

/* FOOTER */
footer { background: #0d5c38; color: rgba(255,255,255,0.7); text-align: center; padding: 24px; font-size: 13px; font-weight: 600; }
footer span { color: #7fffb8; }

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

@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: countUp 0.4s ease forwards; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 820px) {
  .main-wrap { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .tips-grid  { grid-template-columns: 1fr; }
  .hero { padding: 44px 20px 70px; }
}
/* AD BANNER */
.ad-banner {
  max-width: 1060px;
  margin: 60px auto;
  padding: 0 20px;
}
.ad-card {
  background: linear-gradient(135deg, #1a5fd4 0%, #0d3580 100%);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(13,53,128,0.25);
  position: relative;
  overflow: hidden;
}
.ad-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.ad-card > * { position: relative; z-index: 1; }
.ad-icon { font-size: 56px; }
.ad-title { color: #fff; font-size: 28px; font-weight: 900; margin-bottom: 8px; line-height: 1.2; }
.ad-desc { color: rgba(255,255,255,0.85); font-size: 15px; font-weight: 500; max-width: 550px; line-height: 1.7; }
.ad-cta {
  background: #60b0ff;
  color: #0d3580;
  border: none;
  border-radius: 16px;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(96,176,255,0.35);
  margin-top: 12px;
  text-decoration: none;
  display: inline-block;
}
.ad-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(96,176,255,0.45);
  background: #fff;
}
.ad-cta:active { transform: translateY(0); }

@media (max-width: 480px) {
  .card { padding: 24px 18px; }
  .check-card { padding: 24px 18px; }
  .ad-card { padding: 32px 20px; }
  .ad-title { font-size: 22px; }
  .ad-desc { font-size: 14px; }
}
