/* ═══════════════════════════════════════════
   لیبل شناور (Floating Label)
   ═══════════════════════════════════════════ */
.float-field {
  position: relative;
  display: block;
}

.float-field > input,
.float-field > textarea,
.float-field > select {
  width: 100%;
  display: block;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1rem 1rem 0.75rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  text-align: right;
  font-family: inherit;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.4;
}

.float-field > textarea {
  min-height: 5.5rem;
  resize: vertical;
  padding-top: 1.25rem;
}

.float-field > input:focus,
.float-field > textarea:focus,
.float-field > select:focus {
  border-color: #1a7fd6;
  box-shadow: 0 0 0 3px rgba(26, 127, 214, 0.18);
}

/* لیبل — وسط اینپوت خالی */
.float-field > .float-label {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  pointer-events: none;
  transition: top .18s ease, transform .18s ease, font-size .18s ease,
              color .18s ease, background .18s ease;
  z-index: 2;
  max-width: calc(100% - 1.7rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* textarea: لیبل کمی بالاتر از وسط */
.float-field > textarea ~ .float-label {
  top: 1.2rem;
  transform: none;
}

/*
  حالت شناور (روی بوردر):
  - فوکوس
  - placeholder نشان داده نمی‌شود (پر شده)
  - کلاس .is-filled از JS
*/
.float-field > input:focus ~ .float-label,
.float-field > input:not(:placeholder-shown) ~ .float-label,
.float-field > input.is-filled ~ .float-label,
.float-field > textarea:focus ~ .float-label,
.float-field > textarea:not(:placeholder-shown) ~ .float-label,
.float-field > textarea.is-filled ~ .float-label,
.float-field.is-active > .float-label {
  top: 0 !important;
  transform: translateY(-50%) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #1a7fd6 !important;
  background: #fff !important;
}

/* Select و تاریخ: همیشه روی بوردر */
.float-field.float-select > .float-label,
.float-field > .float-label.float-label-fixed {
  top: 0 !important;
  transform: translateY(-50%) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  background: #fff !important;
}

.float-field.float-select > select:focus ~ .float-label,
.float-field.float-select > input:focus ~ .float-label,
.float-field.float-select.is-active > .float-label {
  color: #1a7fd6 !important;
}

.float-field.float-select > select,
.float-field.float-select > input {
  padding-top: 1.05rem;
  padding-bottom: 0.65rem;
}

/* خطا */
.float-field.has-error > input,
.float-field.has-error > textarea,
.float-field.has-error > select {
  border-color: #ef4444;
}
