/* Kasiopes Unified UI Rules
   Additive styling layer: control sizing, button sizing, deterministic section coloring.
*/

:root{
  --ksp-ctrl-h: 40px;
  --ksp-ctrl-h-sm: 34px;
  --ksp-pad-x: 12px;
  --ksp-radius: 12px;
  --ksp-section: #3498db; /* updated by src/ui-kit.js */
}

/* ------------------------------
   Form controls: consistent sizing
   ------------------------------ */
input,
select,
textarea{
  font-family: inherit;
  font-size: 14px;
  color: #111;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: var(--ksp-radius);
  background: #fff;
}

input,
select{
  height: var(--ksp-ctrl-h);
  padding: 0 var(--ksp-pad-x);
}

textarea{
  padding: var(--ksp-pad-x);
  min-height: calc(var(--ksp-ctrl-h) * 2);
  resize: vertical;
}

/* ------------------------------
   Buttons: consistent height / alignment
   ------------------------------ */
.btn,
.menuItem{
  height: var(--ksp-ctrl-h);
  border-radius: var(--ksp-radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.btn{ padding: 0 14px; }

/* Hover / disabled ergonomics */
.btn:hover,
.menuItem:hover{ filter: brightness(.99); }

.btn:disabled,
button:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
}

/* Menu items should look like full-width buttons */
.menuItem{
  width: 100%;
  justify-content: flex-start;
  padding: 0 12px;
}

/* Optional small buttons (tables / compact actions) */
.btn.sm,
.btn.small,
.menuItem.sm{
  height: var(--ksp-ctrl-h-sm);
  font-size: 13px;
  padding: 0 10px;
}

/* ------------------------------
   Section coloring: single logic
   ------------------------------ */
.panel .hd{
  border-top: 4px solid var(--ksp-section);
}

.warn{
  border-left: 4px solid var(--ksp-section);
}

/* Stepper chips: color follows assigned step color */
.chip{
  --ksp-chip: var(--ksp-section);
  /* Inactive chips also follow the same color logic (consistent visual language) */
  border-color: color-mix(in srgb, var(--ksp-chip) 28%, rgba(0,0,0,.12));
}

.chip.active{
  background: color-mix(in srgb, var(--ksp-chip) 14%, #fff);
  border-color: color-mix(in srgb, var(--ksp-chip) 55%, rgba(0,0,0,.12));
  font-weight: 800;
}

.chip.done{
  background: color-mix(in srgb, var(--ksp-chip) 10%, #fff);
  border-color: color-mix(in srgb, var(--ksp-chip) 45%, rgba(0,0,0,.12));
}

/* Focus ring */
input:focus,
select:focus,
textarea:focus,
button:focus{
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ksp-section) 22%, #0000);
}

/* ================================
   Bottom action buttons alignment
   ================================
   Required because the HTML uses .bottomActionsLeft/.bottomActionsRight
   but legacy CSS targets .bottomLeft/.bottomRight.
*/
.bottomActions{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bottomActionsLeft{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bottomActionsRight{
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Keep the right action group tight to the work area edge */
.bottomActionsRight > .btn{
  margin-left: 0;
}

/* =====================================
   Step "4) Размери" - ПОСОКА buttons (dirSwitch)
   Requirement: when direction button is .active -> light green
   ===================================== */
#step-sizes .dirSwitch button.active{
  background: #C8E6C9;      /* light green */
  border-color: #81C784;
  color: #1B5E20;
}

#step-sizes .dirSwitch button{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  cursor: pointer;
}
