/**
 * PisellEmail 组件样式
 * 基于 Figma 设计规范，与 SingleLineText 设计体系一致
 */

.pisell-email {
  &-edit {
    position: relative;
    width: 100%;

    // 仅对 affix-wrapper 设边框，避免与内层 input 双边框（Figma 设计规范）
    .pisell-lowcode-input-affix-wrapper {
      font-size: 16px !important;
      line-height: 24px !important;
      border-radius: 8px !important;
      border: 1px solid #d0d5dd !important; // Gray/300
      padding: 0 !important;
      height: 48px !important;
      color: #101828 !important; // Gray/900
      background-color: #ffffff !important;

      &:focus,
      &:focus-within {
        border-color: #d6bbfb !important; // Primary/300
        box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
        outline: none !important;
      }

      &:hover:not(:focus):not(:focus-within):not([disabled]) {
        border-color: #b692f6 !important; // Primary/400
      }

      &[disabled],
      &.pisell-lowcode-input-disabled {
        background-color: #f9fafb !important; // Gray/50
        color: #98a2b3 !important; // Gray/400
        border-color: #d0d5dd !important;
        cursor: not-allowed !important;
      }
    }

    // 内层 input（无边框，由 wrapper 统一描边）
    .pisell-lowcode-input-affix-wrapper .pisell-lowcode-input {
      &::placeholder {
        color: #667085 !important; // Gray/500
      }
    }

    // 带前缀（邮箱图标）的 Input 容器
    .pisell-lowcode-input-affix-wrapper {

      .pisell-lowcode-input-prefix {
        margin-right: 8px;
        margin-left: 16px;
        color: #667085; // Gray/500
        font-size: 16px;
      }

      .pisell-lowcode-input-suffix {
        margin-left: 8px;
        margin-right: 16px;
        color: #667085;
        font-size: 16px;
      }

      .pisell-lowcode-input {
        padding: 12px 0 !important;
        border: none !important;
        box-shadow: none !important;

        &:focus {
          box-shadow: none !important;
        }
      }
    }

    // 清空按钮
    .pisell-lowcode-input-clear-icon {
      color: #667085 !important;
      font-size: 14px !important;

      &:hover {
        color: #344054 !important; // Gray/700
      }
    }

    // 错误状态
    .pisell-lowcode-input-status-error,
    .pisell-lowcode-input-affix-wrapper-status-error {
      border-color: #fda29b !important; // Error/300

      &:focus,
      &:focus-within {
        border-color: #f97066 !important; // Error/400
        box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
      }

      &:hover:not(:focus):not(:focus-within) {
        border-color: #f97066 !important; // Error/400
      }
    }
  }

  // 错误提示（与设计体系一致）
  &-edit-error {
    margin-top: 4px;
    font-size: 12px;
    color: #d92d20; // Error/600
    line-height: 1.5;
    animation: pisell-email-fadeIn 0.3s ease-in-out;
  }

  &-read {
    display: inline-flex;
    align-items: center;

    .pisell-lowcode-typography-link {
      cursor: pointer;
      transition: color 0.2s ease-in-out;

      &:hover {
        color: #6d48c4 !important;
      }

      &:active {
        color: #5f3da8 !important;
      }
    }
  }

  &-disabled {
    opacity: 0.4;
    cursor: not-allowed;

    * {
      cursor: not-allowed !important;
    }
  }
}

// AutoComplete 下拉样式
.pisell-email-autocomplete-dropdown {
  .pisell-lowcode-select-item-option-content {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

@keyframes pisell-email-fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
