/* Nhãn nổi và chiều cao ô nhập; giữ khoảng cách label/control nhất quán. */

label.floating-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding-top: 26px;
  margin-bottom: 10px;
  isolation: isolate;
}
label.floating-field > input {
  position: relative;
  display: block;
  width: 100%;
  height: 54px;
  min-height: 54px;
  margin: 0;
  padding: 16px 14px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #203a34;
  font-size: 16px;
  letter-spacing: 0.01em;
  box-shadow: none;
  transform: none;
  z-index: 1;
}
label.floating-field > .floating-caption {
  position: absolute;
  top: 43px;
  left: 14px;
  right: 14px;
  color: #536c63;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition:
    transform 220ms ease,
    color 180ms ease;
  z-index: 2;
}
label.floating-field > .floating-surface {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 10px;
  background: linear-gradient(155deg, #d8eee3, #bee0d0);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85), inset 0 -4px 10px rgba(24, 92, 65, 0.04);
  transform: scaleY(0.037);
  transform-origin: center bottom;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
  z-index: 0;
}
label.floating-field:focus-within > .floating-caption,
label.floating-field:has(> input:not(:placeholder-shown)) > .floating-caption,
label.floating-field.has-input-hint > .floating-caption,
label.floating-field:has(> input:-webkit-autofill) > .floating-caption {
  transform: translateY(-43px);
  color: #176b54;
}
label.floating-field:focus-within > .floating-surface,
label.floating-field:has(> input:not(:placeholder-shown)) > .floating-surface,
label.floating-field.has-input-hint > .floating-surface,
label.floating-field:has(> input:-webkit-autofill) > .floating-surface {
  transform: scaleY(1);
}
label.floating-field > input:focus {
  outline: 2px solid #31876d;
  outline-offset: 2px;
  box-shadow: none;
  transform: none;
}
label.floating-field > input:disabled {
  color: #657770;
  cursor: not-allowed;
  background: #f1f4f2;
}
.form-grid label.floating-field {
  margin-bottom: 0;
  align-self: start;
}
.form-grid:has(label.floating-field) {
  row-gap: 14px;
}
label.floating-field.fixed-caption > .floating-caption {
  transform: translateY(-43px);
  color: #536c63;
}
label.floating-field.fixed-caption > .floating-surface {
  display: none;
}
label.floating-field.fixed-caption > input,
label.floating-field.fixed-caption > select,
label.floating-field.fixed-caption > textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 14px;
  border: 1px solid #ccddd6;
  border-radius: 10px;
  background-color: #f6fbf8;
  font-size: 16px;
  line-height: 24px;
  box-shadow: none;
  transform: none;
}
label.floating-field.fixed-caption > input[type="date"] {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding-inline: 10px;
}
label.floating-field.fixed-caption > input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}
label.floating-field.fixed-caption > textarea {
  min-height: 108px;
}
label.floating-field.fixed-caption > select {
  height: 54px;
}
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
 @supports (appearance: base-select) {
  label.floating-field.fixed-caption > select:not([multiple]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  label.floating-field.fixed-caption > select:not([multiple])::picker-icon {
    position: static;
    flex-shrink: 0;
    align-self: center;
    margin: 0;
  }
 }
}
label.floating-field.fixed-caption > input:focus,
label.floating-field.fixed-caption > select:focus,
label.floating-field.fixed-caption > textarea:focus {
  outline: 2px solid #31876d;
  outline-offset: 2px;
  box-shadow: none;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  label.floating-field > .floating-caption,
  label.floating-field > .floating-surface {
    transition: none;
  }
}
