:root{
  --bg:#0b1220;
  --card:#111a2e;
  --text:#e7ecff;
  --muted:#aab6e8;
  --border:#243056;
  --focus:#7aa2ff;
  --danger:#ff6b6b;
  --ok:#35d07f;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% 0%, #14204a 0%, var(--bg) 70%);
  color:var(--text);
}

.container{
  width:min(980px, 92vw);
  margin:24px auto 40px;
}

.header h1{ margin:0 0 6px; font-size:28px; }
.subtitle{ margin:0 0 18px; color:var(--muted); }

.tabs{
  display:flex;
  gap:10px;
  margin:10px 0 14px;
}
.tab{
  flex:1;
  border:1px solid var(--border);
  background: transparent;
  color:var(--text);
  padding:12px 14px;
  border-radius:12px;
  cursor:pointer;
  transition: .15s ease;
}
.tab:hover{ border-color:#3b4a86; }
.tab.active{
  background: linear-gradient(180deg, #1a2a54, #131f3f);
  border-color:#3b4a86;
}

.panel{ display:none; }
.panel.active{ display:block; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.card h2{ margin:0 0 14px; font-size:20px; }

.radioRow{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  margin-bottom:14px;
  background: rgba(0,0,0,.12);
}
.radio{ display:flex; gap:8px; align-items:center; color:var(--text); }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 860px){
  .grid2{ grid-template-columns: 1fr; }
}

.fieldset{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  min-height: 210px;
}
.fieldset legend{ padding:0 8px; color:var(--muted); }

.field{ margin-bottom:12px; position:relative; }
.fieldRow{
  display:grid;
  grid-template-columns: 1fr 160px;
  gap:10px;
}

.legendToggle{
  padding:0 6px;
}

.legendLabel{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(0,0,0,.12);
  cursor:pointer;
  user-select:none;
  color: var(--text);
  white-space: nowrap;
}

.fieldset.disabled .legendLabel{
  opacity:.75;
}

.legendLabel input[type="radio"]{
  transform: scale(1.1);
  cursor:pointer;
}

.fieldset{
  /* שיהיה מקום לlegend “כפתור” יפה */
  padding-top:14px;
}

.fieldset legend{
  /* כדי שהמסגרת לא תקטע מוזר */
  float: unset;
}

label{ display:block; margin-bottom:6px; color:var(--muted); font-size:13px; }

input, select{
  width:100%;
  border:1px solid var(--border);
  background:#0d162c;
  color:var(--text);
  padding:10px 10px;
  border-radius:10px;
  outline:none;
}
input:focus, select:focus{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(122,162,255,.15);
}

.hint{ margin-top:6px; font-size:12px; color:var(--muted); }

.actions{
  display:flex;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}
.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
}
.btn.primary{
  border-color:#3b4a86;
  background: linear-gradient(180deg, #28418a, #1b2f66);
}
.btn:active{ transform: translateY(1px); }

.result{ margin-top:14px; }
.resultBox{
  margin:8px 0 0;
  padding:12px;
  border-radius:12px;
  background:#0d162c;
  border:1px solid var(--border);
  min-height: 52px;
  white-space: pre-wrap;
}

.footer{ margin-top:14px; color:var(--muted); }

.disabled{
  opacity:.55;
}
.disabled input,
.disabled select{
  cursor:not-allowed;
}

.suggestions{
  position:absolute;
  top: calc(100% + 6px);
  right:0;
  left:0;
  z-index:50;
  display:none;
  background:#0d162c;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
}
.suggestions .item{
  padding:10px 10px;
  cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.suggestions .item:last-child{ border-bottom:none; }
.suggestions .item:hover{ background: rgba(122,162,255,.12); }

.msg-ok{ color: var(--ok); }
.msg-err{ color: var(--danger); }