:root {
  --bg: #090a0f;
  --card: #12141c;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(247, 147, 26, 0.4);
  --card-hover: #171a24;
  
  --accent: #f7931a;
  --accent-hover: #e07f0b;
  --accent-gradient: linear-gradient(135deg, #f7931a 0%, #ff5500 100%);
  --accent-subtle: rgba(247, 147, 26, 0.15);
  
  --gold-gradient: linear-gradient(135deg, #f7931a 0%, #ffb74d 100%);
  --cyan-gradient: linear-gradient(135deg, #00d2ff 0%, #0052ff 100%);
  --green-gradient: linear-gradient(135deg, #05b169 0%, #00e699 100%);
  
  --acc-btn-color: #00e699;
  --acc-btn-hover: #00c784;

  --text: #ffffff;
  --muted: #8a91a8;
  --success: #00e699;
  --danger: #ef4444;
  --font-base: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html {
  font-size: var(--font-base);
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(247, 147, 26, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 10%, rgba(255, 85, 0, 0.06) 0px, transparent 40%),
    radial-gradient(at 50% 100%, rgba(0, 230, 153, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 16px;
  line-height: 1.6;
}

/* נגישות */
body.acc-grayscale { filter: grayscale(100%); }
body.acc-invert { filter: invert(100%) hue-rotate(180deg); }
body.acc-highlight-links a { text-decoration: underline !important; background-color: #ffff00 !important; color: #000 !important; }
body.acc-readable-font * { font-family: Arial, Tahoma, sans-serif !important; }

/* הדר עליון */
header {
  text-align: center;
  margin-bottom: 36px;
  max-width: 860px;
  width: 100%;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.brand-badge .pill {
  background: var(--gold-gradient);
  color: #000;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 800;
}

header h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff 30%, #9ca3af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--muted);
  font-size: 1.12rem;
  margin-top: 10px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

/* תפריט עליון */
.sub-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.sub-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  background: rgba(18, 20, 28, 0.7);
  border: 1px solid var(--card-border);
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.sub-nav a .nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.sub-nav a:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: var(--card-hover);
  transform: translateY(-2px);
}

.sub-nav a.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent-subtle);
  box-shadow: 0 0 25px -5px rgba(247, 147, 26, 0.35);
}

/* גריד וכרטיסים */
.container {
  max-width: 900px;
  width: 100%;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1060px;
  width: 100%;
}

@media (min-width: 860px) {
  .main-grid {
    grid-template-columns: 1.15fr 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s;
}

.card:hover {
  border-color: var(--card-hover-border);
}

.card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 14px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 24px 0 12px 0;
  color: #ffffff;
}

.card p, .card ul {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 0.98rem;
}

.card ul { padding-right: 20px; }
.card li { margin-bottom: 8px; }

/* שדות קלט וטפסים */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrapper span {
  position: absolute;
  left: 16px;
  right: auto;
  color: #6b7280;
  font-weight: 700;
  pointer-events: none;
}

.field input, .field select, textarea {
  width: 100%;
  background: #090a0f !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  color: #ffffff !important;
  font-size: 1.05rem !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  display: block;
  box-sizing: border-box;
}

.field input[type="number"], .input-wrapper input {
  padding-left: 42px !important;
  direction: ltr;
  text-align: right;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus, .field select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(247, 147, 26, 0.2) !important;
  background: #0d0f17 !important;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  cursor: pointer;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.checkbox-field input {
  accent-color: var(--accent);
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* באנר תוצאות */
.net-banner {
  background: linear-gradient(180deg, rgba(247, 147, 26, 0.15) 0%, rgba(18, 20, 28, 0.8) 100%);
  border: 1px solid rgba(247, 147, 26, 0.4);
  border-radius: 20px;
  padding: 26px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 10px 30px -10px rgba(247, 147, 26, 0.25);
}

.net-banner .title {
  font-size: 0.95rem;
  color: #ffb74d;
  margin-bottom: 6px;
  font-weight: 600;
}

.net-banner .amount {
  font-size: 2.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -1.5px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.96rem;
}

.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .val { font-weight: 700; color: #ffffff; }
.breakdown-row .deduction { color: var(--danger); }

/* גרף התפלגות */
.bar-container {
  margin-top: 24px;
  height: 12px;
  border-radius: 6px;
  background: #1f2433;
  display: flex;
  overflow: hidden;
}

.bar-segment { height: 100%; transition: width 0.35s ease; }
.bar-net { background: var(--accent-gradient); }
.bar-tax { background-color: var(--danger); }
.bar-ss { background: var(--cyan-gradient); }
.bar-pension { background: linear-gradient(135deg, #a855f7, #ec4899); }

.legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-item { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* מתג ברוטו/נטו */
.calc-mode-toggle {
  display: flex;
  background: #090a0f;
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 3px;
  gap: 4px;
}

.mode-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(247, 147, 26, 0.4);
}

/* כפתורי פעולה */
.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .action-buttons-grid {
    grid-template-columns: 1fr;
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(247, 147, 26, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-action {
  background: var(--accent-gradient);
  border: none;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(247, 147, 26, 0.3);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(247, 147, 26, 0.45);
}

.btn-outline {
  width: 100%;
  background: none;
  border: 1px dashed var(--card-border);
  color: var(--muted);
  padding: 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: #ffffff;
}

.share-toast {
  display: none;
  text-align: center;
  background: rgba(0, 230, 153, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 10px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 10px;
}

/* טבלאות והטמעה */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  text-align: right;
  border-radius: 12px;
  overflow: hidden;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  font-size: 0.95rem;
}

.data-table th { background: #0c0e15; color: #ffffff; font-weight: 700; }
.data-table tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.embed-box {
  background: #090a0f;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  font-family: monospace;
  font-size: 0.88rem;
  color: #ffb74d;
  word-break: break-all;
  user-select: all;
}

/* פוטר */
footer {
  margin-top: 56px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  width: 100%;
  border-top: 1px solid var(--card-border);
  padding-top: 28px;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.legal-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-links a:hover {
  color: #ffffff;
}

/* שורת עוגיות דו-לשונית */
.cookie-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
  margin: 18px auto 14px auto;
  max-width: 960px;
  font-size: 0.8rem;
  font-weight: 300;
  color: #717688;
  line-height: 1.4;
}

.cookie-col.he { text-align: right; direction: rtl; flex: 1; }
.cookie-col.en { text-align: left; direction: ltr; flex: 1; }
.cookie-bar a { color: #8b92a5; text-decoration: underline; margin-inline-start: 4px; }
.cookie-bar a:hover { color: #ffffff; }

.cookie-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cookie-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

@media (max-width: 768px) {
  .cookie-bar {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .cookie-col.he, .cookie-col.en { text-align: center; }
}

/* כפתור וסרגל נגישות ירוק */
.acc-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
}

.acc-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--acc-btn-color) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 25px rgba(0, 230, 153, 0.5) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.acc-btn:hover {
  transform: scale(1.12);
  background: var(--acc-btn-hover) !important;
}

.acc-btn svg {
  width: 28px;
  height: 28px;
  fill: #090a0f !important;
}

.acc-menu {
  display: none;
  position: absolute;
  bottom: 66px;
  left: 0;
  width: 300px;
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  text-align: right;
  backdrop-filter: blur(16px);
}

.acc-menu.active { display: block; }

.acc-menu-header {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 10px;
}

.acc-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.acc-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.acc-opt-btn {
  background: #090a0f;
  border: 1px solid var(--card-border);
  color: #f3f4f6;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.acc-opt-btn:hover, .acc-opt-btn.active-opt {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent-subtle);
}

.acc-reset-btn {
  grid-column: span 2;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 11px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}

/* הדפסה ו-PDF */
.print-header, .print-footer {
  display: none !important;
}

@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
    padding: 0 !important;
  }
  .no-print, header, footer, .acc-widget, .sub-nav, .brand-badge {
    display: none !important;
  }
  .print-header {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #f7931a;
    padding-bottom: 12px;
    margin-bottom: 24px;
  }
  .print-logo { font-size: 2rem; font-weight: 900; color: #f7931a; }
  .print-tagline { font-size: 0.9rem; color: #555; margin-top: 4px; }
  .print-meta { font-size: 0.8rem; color: #777; margin-top: 6px; }
  .print-footer { display: block !important; margin-top: 30px; text-align: center; font-size: 0.82rem; color: #666; }
  #resultsSection { background: #ffffff !important; border: 1px solid #ddd !important; box-shadow: none !important; color: #111 !important; width: 100% !important; max-width: 100% !important; }
  .net-banner { background: #fdf6ec !important; border: 2px solid #f7931a !important; color: #000 !important; }
  .net-banner .amount { color: #f7931a !important; }
  .breakdown-row { border-bottom: 1px solid #eee !important; color: #222 !important; }
  .breakdown-row .val { color: #000 !important; }
  .bar-container, .action-buttons-grid, .share-toast { display: none !important; }
}
