/* ============================================================
   表单.css — VA-UI H5 表单组件
   Input / Select / Textarea / Radio / Switch / Picker
   垂直布局：label在上，input在下
   ============================================================ */

/* --- 表单容器 --- */
.va-form {
  padding: 0 16px;
}

/* --- 表单项 --- */
.va-form-item {
  padding: 10px 0;
  position: relative;
}

.va-form-item + .va-form-item {
  /* 无分割线，靠间距区分 */
}

/* --- 标签 --- */
.va-form-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--va-text-body);
  margin-bottom: 8px;
  line-height: 1.5;
}

.va-form-label-required .va-required-mark {
  margin-right: 4px;
}

/* --- 输入框基础 --- */
.va-input {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--va-input-height);
  padding: 0 12px;
  font-size: 14px;
  color: var(--va-text-body);
  background: var(--va-bg-base);
  border: 1px solid var(--va-border);
  border-radius: var(--va-input-radius);
  transition: all var(--va-duration-normal) var(--va-ease-out);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.va-input:hover {
  border-color: var(--va-primary);
}

.va-input:focus {
  border-color: var(--va-primary);
  box-shadow: var(--va-shadow-focus);
}

.va-input::placeholder {
  color: var(--va-text-placeholder);
}

/* --- 输入框禁用态 --- */
.va-input[disabled],
.va-input.va-disabled {
  background: var(--va-bg-disabled);
  color: var(--va-text-disabled);
  cursor: not-allowed;
  border-color: var(--va-border-light);
}

.va-input[disabled]:hover,
.va-input.va-disabled:hover {
  border-color: var(--va-border-light);
  box-shadow: none;
}

/* --- 输入框错误态 --- */
.va-input-error {
  border-color: var(--va-error) !important;
}

.va-input-error:focus {
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.15) !important;
}

/* --- 错误提示文字 --- */
.va-form-error {
  font-size: 12px;
  color: var(--va-error);
  margin-top: 4px;
  line-height: 1.5;
  animation: va-fade-in var(--va-duration-fast);
}

/* --- 文本域 --- */
.va-textarea {
  display: block;
  width: 100%;
  min-height: 80px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--va-text-body);
  background: var(--va-bg-base);
  border: 1px solid var(--va-border);
  border-radius: var(--va-input-radius);
  resize: vertical;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: all var(--va-duration-normal) var(--va-ease-out);
  line-height: 1.5;
}

.va-textarea:focus {
  border-color: var(--va-primary);
  box-shadow: var(--va-shadow-focus);
}

.va-textarea::placeholder {
  color: var(--va-text-placeholder);
}

/* --- Select 触发器 --- */
.va-select {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--va-input-height);
  padding: 0 32px 0 12px;
  font-size: 14px;
  color: var(--va-text-body);
  background: var(--va-bg-base);
  border: 1px solid var(--va-border);
  border-radius: var(--va-input-radius);
  cursor: pointer;
  transition: all var(--va-duration-normal) var(--va-ease-out);
  -webkit-user-select: none;
  user-select: none;
}

.va-select:hover {
  border-color: var(--va-primary);
}

.va-select-active {
  border-color: var(--va-primary);
  box-shadow: var(--va-shadow-focus);
}

/* --- Select 箭头 --- */
.va-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 16px;
  height: 16px;
  transition: transform var(--va-duration-normal) var(--va-ease-out);
  pointer-events: none;
  fill: var(--va-text-secondary);
}

.va-select-active .va-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* --- Select Placeholder --- */
.va-select-placeholder {
  color: var(--va-text-placeholder);
}

/* --- Select 下拉面板 --- */
.va-select-dropdown {
  position: absolute;
  background: var(--va-bg-base);
  border-radius: var(--va-radius-sm);
  box-shadow: var(--va-shadow-lg);
  z-index: var(--va-z-popup);
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: va-fade-in var(--va-duration-fast);
  padding: 4px 0;
}

.va-select-option {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--va-text-body);
  cursor: pointer;
  transition: background var(--va-duration-fast);
  position: relative;
}

.va-select-option:hover {
  background: var(--va-bg-light);
}

.va-select-option-selected {
  color: var(--va-primary);
  font-weight: 600;
  background: var(--va-primary-light);
}

/* 选中项圆点已移除 */

.va-select-option-disabled {
  color: var(--va-text-disabled);
  cursor: not-allowed;
}

/* --- Radio --- */
.va-radio-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.va-radio {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  min-height: 44px;
  transition: opacity var(--va-duration-fast);
}

.va-radio:active {
  opacity: 0.7;
}

.va-radio-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.va-radio-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--va-border);
  border-radius: 50%;
  margin-right: 8px;
  transition: all var(--va-duration-normal) var(--va-ease-out);
  flex-shrink: 0;
}

.va-radio-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: all var(--va-duration-normal) var(--va-ease-back);
  transform: scale(0);
}

.va-radio-checked .va-radio-circle {
  border-color: var(--va-primary);
}

.va-radio-checked .va-radio-circle::after {
  background: var(--va-primary);
  transform: scale(1);
}

.va-radio-label {
  font-size: 14px;
  color: var(--va-text-body);
  /* 选中不改变文字颜色 */
}

/* --- Switch --- */
.va-switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 22px;
  border-radius: var(--va-radius-full);
  background: var(--va-border);
  cursor: pointer;
  transition: background var(--va-duration-normal) var(--va-ease-out);
  flex-shrink: 0;
}

.va-switch-active {
  background: var(--va-primary);
}

.va-switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--va-duration-normal) var(--va-ease-out);
}

.va-switch-active .va-switch-handle {
  transform: translateX(22px);
}

.va-switch-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- 表单验证抖动动画 --- */
@keyframes va-form-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.va-form-shake {
  animation: va-form-shake 0.3s;
}


/* ============================================================
   Ant Design 规范：Checkbox 复选框 & Radio 单选框组件
   ============================================================ */

/* --- Checkbox 复选框 (AntD Standard) --- */
.va-checkbox-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.va-checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5715;
  color: #1D2129;
  user-select: none;
  transition: color 0.2s ease;
}

.va-checkbox-wrapper:hover .va-checkbox-inner {
  border-color: #1677ff;
}

.va-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  outline: none;
  cursor: pointer;
}

.va-checkbox-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.va-checkbox-inner {
  position: relative;
  top: 0;
  left: 0;
  display: block;
  width: 16px;
  height: 16px;
  direction: ltr;
  background-color: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.va-checkbox-inner::after {
  content: ' ';
  position: absolute;
  top: 45%;
  left: 22%;
  display: table;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) scale(0) translate(-50%, -50%);
  opacity: 0;
  transition: transform 0.15s cubic-bezier(0.71, -0.46, 0.88, 0.6) 0.05s, opacity 0.15s;
  box-sizing: border-box;
}

.va-checkbox-checked .va-checkbox-inner {
  background-color: #1677ff;
  border-color: #1677ff;
}

.va-checkbox-checked .va-checkbox-inner::after {
  transform: rotate(45deg) scale(1) translate(-50%, -50%);
  opacity: 1;
  transition: transform 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
}

.va-checkbox-label {
  font-size: 14px;
  color: #1D2129;
}

/* --- Radio 单选框 (AntD Standard) --- */
.va-radio-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.va-radio-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5715;
  color: #1D2129;
  user-select: none;
  transition: color 0.2s ease;
}

.va-radio-wrapper:hover .va-radio-inner,
.va-radio-wrapper:hover .va-radio-circle {
  border-color: #1677ff;
}

.va-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  outline: none;
  cursor: pointer;
}

.va-radio-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.va-radio-inner, .va-radio-circle {
  position: relative;
  top: 0;
  left: 0;
  display: block;
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 50%;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.va-radio-inner::after, .va-radio-circle::after {
  content: ' ';
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  margin-left: -4px;
  background-color: #1677ff;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.78, 0.14, 0.15, 0.86);
}

.va-radio-checked .va-radio-inner,
.va-radio-checked .va-radio-circle {
  border-color: #1677ff;
}

.va-radio-checked .va-radio-inner::after,
.va-radio-checked .va-radio-circle::after {
  transform: scale(1);
  opacity: 1;
  background-color: #1677ff;
}

.va-radio-label {
  font-size: 14px;
  color: #1D2129;
}

